c language functions - Mailing list pgsql-hackers

From Rodrigo Barboza
Subject c language functions
Date
Msg-id CANs8QJYY58rB+bprkSnxsSePJc2EazgUGpBs90Et_bd__9in5Q@mail.gmail.com
Whole thread Raw
Responses Re: c language functions
List pgsql-hackers
Hello.
I'm trying to create a generic add function.
I have defined a type my_uint and it needs a '+' operator.
This operator should work like normal int + int operation.
The function is defined expecting arguments (my_uint, anyelement).

I'm confused in retrieving the anyelement type, value and than do the add operation and return the correct value and type.
I tried to use PG_GETARG_DATUM, but I don't know how to extract the value from it (should it be a uint32, uint64, float or double).

Any tips?


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Regex with > 32k different chars causes a backend crash
Next
From: Gavin Flower
Date:
Subject: Re: [PATCH] Exorcise "zero-dimensional" arrays (Was: Re: Should array_length() Return NULL)