Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cZfMb-0005F0-1l for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Feb 2017 15:01:25 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cZfMa-00082p-48 for pgsql-hackers@arkaria.postgresql.org; Fri, 03 Feb 2017 15:01:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cZfLA-0006Kk-5D for pgsql-hackers@postgresql.org; Fri, 03 Feb 2017 14:59:56 +0000 Received: from mail-qk0-x243.google.com ([2607:f8b0:400d:c09::243]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cZfL5-0002qF-P7 for pgsql-hackers@postgresql.org; Fri, 03 Feb 2017 14:59:55 +0000 Received: by mail-qk0-x243.google.com with SMTP id 11so41509qkl.0 for ; Fri, 03 Feb 2017 06:59:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Hq8wEQ5xsREEwgiv5BAnxmxuYlDAc/RwxIKaKHk6kCM=; b=U6PIuxqEYPXUbyvjuT0KVc3GM2A1RpYq9fzYi/CxeBmbhkPLSUlPZzCxZP/sJwuEdP GZjDWF1GOw0GTaKPaMKltqm+xpEzmfkbG3h2UNeZH02SwkTNFWqmT2R+9nzgFP+53KFH l4vV0hetWbRpXdrBBB9gVeFG+pLaCzhCAtK2df6Q52kuecz0mWdsIoUeNGNRE4+x7ikP c+5/+ZXAXLjimqB/T8ieoxJkctHkuDP5TPcNZbV9mBPfGzCKbT/HBl9+GNQN7fhznGD+ MBdBV1mWPQhGIrjAUYhwblVYWP2zh4Fugy146PpEyfk9bZuM7OwQaGEGoiSAHxcH+WkV wYPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Hq8wEQ5xsREEwgiv5BAnxmxuYlDAc/RwxIKaKHk6kCM=; b=k9vAF7TBUJRCxRMBoAB+420MMO1xJ2vTnEzJdHFpNcN2kNSGjyAGXWIuzDGWqIzqVh vNUzBrDDBHcKkUW/VsYmSoNkJ3jFVwd2+1JPskvWyn4FRq+GpJvDA0aaaytjnYHRsQRM kmOgCHKUJT2K3a55Gh++kZEvWCBP53PIVWkeWjgiQPJSPnoLq0qguzaaHPmjvGU1DJLt 4PWm7fBrGTquleGo8/sMPaIvjAoKkOnNroK0Iw1azk+xYY2a1ejqGcG11WJkggaVA1R9 V0yK/9enkScLSyYdRIV6btDb7uOtSWQ6o0T2wvngmb/hwQBnvyPXX/BPPyUPiqhUx1D1 4OPw== X-Gm-Message-State: AMke39mYXUiXk13mF1hWvTTD+AI/ZsyXmKx+0gBcjhKs5k58Fc/1ke3Yv95kbhYhJxcKWRKYG1tXeXl5AYvxfg== X-Received: by 10.55.89.196 with SMTP id n187mr13656772qkb.17.1486133989756; Fri, 03 Feb 2017 06:59:49 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.61.72 with HTTP; Fri, 3 Feb 2017 06:59:49 -0800 (PST) In-Reply-To: References: <16740.1486093251@sss.pgh.pa.us> <18461.1486094419@sss.pgh.pa.us> <19193.1486095398@sss.pgh.pa.us> From: Robert Haas Date: Fri, 3 Feb 2017 09:59:49 -0500 Message-ID: Subject: Re: [COMMITTERS] pgsql: pageinspect: Try to fix some bugs in previous commit. To: Ashutosh Sharma Cc: Amit Kapila , Tom Lane , "pgsql-hackers@postgresql.org" Content-Type: text/plain; charset=UTF-8 X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On Fri, Feb 3, 2017 at 7:41 AM, Ashutosh Sharma wrote: > I think UInt32GetDatum(metad->hashm_procid) looks fine, the reason > being 'hashm_procid' is defined as 32-bit unsigned integer but then we > may have to define procid as int8 in SQL function. No, you're wrong. The GetDatum you choose macro has to match the SQL type, not the type of the variable that you're passing to it. For example, if you've got an "int" in the code and the SQL type is "int8", you have to use Int64GetDatum, not Int32GetDatum. Otherwise, stuff breaks, because on some systems 64-bit integers are passed by reference, not by value, so the representation that Int32GetDatum produces isn't valid when interpreted by DatumGetInt64 later on. The latter is expecting a pointer, but the former didn't produce one. > Note: I am extremely sorry for wrongly choosing some of the SQL types > in the patch for pageinspect. I think there were few platform specific > things that too should have been addressed by me. Moreover, I feel > being the owner of this project I should have participated in this > discussion a bit earlier but as I was not subscribed to > pgsql-committers list I could not be on time. It might be a good idea to subscribe to pgsql-committers; that way you can follow what's getting committed, whether it is your patch or otherwise. But we also should perhaps have migrated this discussion to pgsql-hackers. Adjusting recipient list. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers