pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <robertmhaas@gmail.com>
To: Ashutosh Sharma <ashu.coek88@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: [COMMITTERS] pgsql: pageinspect: Try to fix some bugs in previous commit.
Date: Fri, 3 Feb 2017 09:59:49 -0500
Message-ID: <CA+TgmoZmkjBTyPRC+oG7LSZb_UEAFZ+0tyrSeqPaDMkYfoWOaQ@mail.gmail.com> (raw)
In-Reply-To: <CAE9k0PnZDNhpoav6qBVxDQ_C+M9VObKdmu9_-6mgDbVYZOnLKg@mail.gmail.com>
References: <E1cZUc7-0001gM-ES@gemulon.postgresql.org>
	<16740.1486093251@sss.pgh.pa.us>
	<CA+TgmobbOWS6KLR-WEK7xqdJmo=dMSLL3Yueh5UwwYnAdDoUGg@mail.gmail.com>
	<18461.1486094419@sss.pgh.pa.us>
	<CA+TgmoZLfE6_RiXSPWfneOXwsrwcryr_bPua=8mVoTnh-hk2AQ@mail.gmail.com>
	<19193.1486095398@sss.pgh.pa.us>
	<CAA4eK1JwFBHGEAnQUse-geA_E6Y9HJVQCMA0OakM86zugynKaA@mail.gmail.com>
	<CAE9k0PnZDNhpoav6qBVxDQ_C+M9VObKdmu9_-6mgDbVYZOnLKg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On Fri, Feb 3, 2017 at 7:41 AM, Ashutosh Sharma <ashu.coek88@gmail.com> 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



view thread (22+ messages)  latest in thread

Message-ID: <CA+TgmoZmkjBTyPRC+oG7LSZb_UEAFZ+0tyrSeqPaDMkYfoWOaQ@mail.gmail.com>
Permalink:  ../CA+TgmoZmkjBTyPRC+oG7LSZb_UEAFZ+0tyrSeqPaDMkYfoWOaQ@mail.gmail.com/
Also on:    postgresql.org/message-id/CA+TgmoZmkjBTyPRC+oG7LSZb_UEAFZ+0tyrSeqPaDMkYfoWOaQ@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: robertmhaas@gmail.com, ashu.coek88@gmail.com, amit.kapila16@gmail.com, tgl@sss.pgh.pa.us, pgsql-hackers@postgresql.org
  Subject: Re: [COMMITTERS] pgsql: pageinspect: Try to fix some bugs in previous commit.
  In-Reply-To: <CA+TgmoZmkjBTyPRC+oG7LSZb_UEAFZ+0tyrSeqPaDMkYfoWOaQ@mail.gmail.com>
  References: <E1cZUc7-0001gM-ES@gemulon.postgresql.org> <16740.1486093251@sss.pgh.pa.us> <CA+TgmobbOWS6KLR-WEK7xqdJmo=dMSLL3Yueh5UwwYnAdDoUGg@mail.gmail.com> <18461.1486094419@sss.pgh.pa.us> <CA+TgmoZLfE6_RiXSPWfneOXwsrwcryr_bPua=8mVoTnh-hk2AQ@mail.gmail.com> <19193.1486095398@sss.pgh.pa.us> <CAA4eK1JwFBHGEAnQUse-geA_E6Y9HJVQCMA0OakM86zugynKaA@mail.gmail.com> <CAE9k0PnZDNhpoav6qBVxDQ_C+M9VObKdmu9_-6mgDbVYZOnLKg@mail.gmail.com> <CA+TgmoZmkjBTyPRC+oG7LSZb_UEAFZ+0tyrSeqPaDMkYfoWOaQ@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox