Why there is a PG_GETARG_UINT32 and PG_RETURN_UINT32?
Why there is a PG_GETARG_UINT32 and PG_RETURN_UINT32?
От:
Rodrigo Barboza <rodrigombufrj@gmail.com>
Дата:
Hi guys.
I am wondering when I can use the PG_GETARG_UINT32 and PG_RETURN_UINT32.
If postgres has no unsigned int type, what is the use of these macros?
Re: Why there is a PG_GETARG_UINT32 and PG_RETURN_UINT32?
От:
Amit Kapila <amit.kapila@huawei.com>
Дата:
On Thursday, April 04, 2013 8:30 PM Rodrigo Barboza wrote: > Hi guys. > I am wondering when I can use the PG_GETARG_UINT32 and PG_RETURN_UINT32. > If postgres has no unsigned int type, what is the use of these macros? They are mainly used for contrib module functionality or some built-in functions which are not exposed. For example, bt_page_items() receives relation name (text) and block number (int), but internally the block number is unit32 as max blocks can be oxFFFFFFFE. With Regards, Amit Kapila.
Re: Why there is a PG_GETARG_UINT32 and PG_RETURN_UINT32?
От:
Rodrigo Barboza <rodrigombufrj@gmail.com>
Дата:
I am creating my own uint32 type and faced this function.
But my args are always of type my_int and one of the signed int types as postgres doesn't hava unsigned.
Could I use those functions in operations between those types?
I can't see a place for this, I don't know if I am missing something....
On Fri, Apr 5, 2013 at 1:12 AM, Amit Kapila <amit.kapila@huawei.com> wrote:
They are mainly used for contrib module functionality or some built-inOn Thursday, April 04, 2013 8:30 PM Rodrigo Barboza wrote:
> Hi guys.
> I am wondering when I can use the PG_GETARG_UINT32 and PG_RETURN_UINT32.
> If postgres has no unsigned int type, what is the use of these macros?
functions which are not exposed.
For example, bt_page_items() receives relation name (text) and block number
(int), but internally the block number
is unit32 as max blocks can be oxFFFFFFFE.
With Regards,
Amit Kapila.
Re: Why there is a PG_GETARG_UINT32 and PG_RETURN_UINT32?
От:
Amit Kapila <amit.kapila@huawei.com>
Дата:
On Friday, April 05, 2013 10:00 AM Rodrigo Barboza wrote: > I am creating my own uint32 type and faced this function. > But my args are always of type my_int and one of the signed int types as postgres doesn't hava unsigned. > Could I use those functions in operations between those types? It should not be a problem if your signed type doesn't have any negative value. > I can't see a place for this, I don't know if I am missing something.... >On Fri, Apr 5, 2013 at 1:12 AM, Amit Kapila wrote: >>On Thursday, April 04, 2013 8:30 PM Rodrigo Barboza wrote: >> Hi guys. >> I am wondering when I can use the PG_GETARG_UINT32 and PG_RETURN_UINT32. >> If postgres has no unsigned int type, what is the use of these macros? > They are mainly used for contrib module functionality or some built-in > functions which are not exposed. > For example, bt_page_items() receives relation name (text) and block number > (int), but internally the block number > is unit32 as max blocks can be oxFFFFFFFE. With Regards, Amit Kapila.