Re: Improper use about DatumGetInt32
От | Robert Haas |
---|---|
Тема | Re: Improper use about DatumGetInt32 |
Дата | |
Msg-id | CA+TgmoYMP0PxbyAwYTunXuxTCS16=92+=cou8FpgJQuxpcGV2A@mail.gmail.com обсуждение исходный текст |
Ответ на | Improper use about DatumGetInt32 ("Hou, Zhijie" <houzj.fnst@cn.fujitsu.com>) |
Ответы |
Re: Improper use about DatumGetInt32
Re: Improper use about DatumGetInt32 |
Список | pgsql-hackers |
On Sun, Sep 20, 2020 at 9:17 PM Hou, Zhijie <houzj.fnst@cn.fujitsu.com> wrote: > In (/contrib/bloom/blutils.c:277), I found it use DatumGetInt32 to get UInt32 type. > Is it more appropriate to use DatumGetUInt32 here? Typically, the DatumGetBlah() function that you pick should match the SQL data type that the function is returning. So if the function returns pg_catalog.int4, which corresponds to the C data type int32, you would use DatumGetInt32. 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. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
В списке pgsql-hackers по дате отправления: