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

From Andres Freund
Subject Re: Improper use about DatumGetInt32
Date
Msg-id 20200921195311.3uq32ddfy5r5gpbg@alap3.anarazel.de
Whole thread Raw
In response to Re: Improper use about DatumGetInt32  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Improper use about DatumGetInt32  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Hi,

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. There's not a lot of those, but there e.g. is
pg_class.relpages.  There also may be places where we use it for
functions that can be created but not called from SQL (using the
INTERNAL type).

- Andres



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: pgindent vs dtrace on macos
Next
From: Tomas Vondra
Date:
Subject: Re: WIP: BRIN multi-range indexes