Re: what is the meaning of Datum? - Mailing list pgsql-general

From Tom Lane
Subject Re: what is the meaning of Datum?
Date
Msg-id 25330.1277316506@sss.pgh.pa.us
Whole thread Raw
In response to Re: what is the meaning of Datum?  (Teodor Macicas <teodor.macicas@epfl.ch>)
List pgsql-general
Teodor Macicas <teodor.macicas@epfl.ch> writes:
> Tom Lane wrote:
>> C code will work with a value in a "native" representation, and then
>> convert to or from Datum in order to pass the value through
>> data-type-independent interfaces.

> And how this convertions will be made ?
> Are there internal functions to do this ?

Usually you should use the appropriate DatumGetXXX or XXXGetDatum
macro, or possibly the PG_GET_XXX or PG_RETURN_XXX wrappers for those.
Whether that's a simple cast or a function call is the macro's business.

            regards, tom lane

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: what happens to postmaster?
Next
From: Tom Lane
Date:
Subject: Re: unexpected effect of FOREIGN KEY ON CASCADE DELETE