Re: Improper use about DatumGetInt32 - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Improper use about DatumGetInt32
Date
Msg-id CA+TgmoY-NprozSN0R3AO+=AoqymLi2fquAscQwD3K-QGjr-Rug@mail.gmail.com
Whole thread Raw
In response to Re: Improper use about DatumGetInt32  (Andres Freund <andres@anarazel.de>)
Responses Re: Improper use about DatumGetInt32  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, Sep 21, 2020 at 3:53 PM Andres Freund <andres@anarazel.de> wrote:
> On 2020-09-21 14:08:22 -0400, Robert Haas wrote:
> > There is no SQL type corresponding to the C data type uint32, so I'm
> > not sure why we even have DatumGetUInt32.  I'm sort of suspicious that
> > there's some fuzzy thinking going on there.
>
> I think we mostly use it for the few places where we currently expose
> data as a signed integer on the SQL level, but internally actually treat
> it as a unsigned data.

So why is the right solution to that not DatumGetInt32() + a cast to uint32?

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: new heapcheck contrib module
Next
From: Tom Lane
Date:
Subject: Re: Lift line-length limit for pg_service.conf