Re: DatumGetInetP buggy - Mailing list pgsql-hackers

From Tom Lane
Subject Re: DatumGetInetP buggy
Date
Msg-id 20757.1320764786@sss.pgh.pa.us
Whole thread Raw
In response to Re: DatumGetInetP buggy  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: DatumGetInetP buggy
List pgsql-hackers
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> Hmm, it seems to be intentional, but I agree it's very much contrary to 
> the usual convention that DatumGetXXXP() returns a detoasted and 
> depacked datum. I think we should change it. I propose the attached 
> patch. It changes DatumGetInetP() to do PG_DETOAST_DATUM(), and adds new 
> DatumGetInetPP() macro to return the packed version. I also moved the 
> access macros like ip_family() from network.c to inet.h, so that they're 
> available for whoever wants to look at the fields without having to depack.

No objection to making the DatumGet macro names conform to common
convention, but I'm not thrilled with moving those special-purpose
accessor macros into wider circulation.  It's not necessary and the
macros don't work unless used in a particular way per the comment,
so I don't think they can be considered general purpose.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Marko Kreen
Date:
Subject: Re: Disable OpenSSL compression
Next
From: Simon Riggs
Date:
Subject: Re: heap vacuum & cleanup locks