Re: immutable functions and enumerate type casts in indexes - Mailing list pgsql-general

From Tom Lane
Subject Re: immutable functions and enumerate type casts in indexes
Date
Msg-id 20763.1220453608@sss.pgh.pa.us
Whole thread Raw
In response to Re: immutable functions and enumerate type casts in indexes  (Edoardo Panfili <edoardo@aspix.it>)
Responses Re: immutable functions and enumerate type casts in indexes  (Edoardo Panfili <edoardo@aspix.it>)
List pgsql-general
Edoardo Panfili <edoardo@aspix.it> writes:
>     labelDatum = DirectFunctionCall1(enum_out,datumIbrido);
>     label = (char *) DatumGetPointer(labelDatum);

Just FYI, preferred style for the second line would be

    label = DatumGetCString(labelDatum);

Nearly all standard data types have DatumGetFoo and FooGetDatum
macros to hide the conversion details (even if it's only a cast).

            regards, tom lane

pgsql-general by date:

Previous
From: Edoardo Panfili
Date:
Subject: Re: immutable functions and enumerate type casts in indexes
Next
From: Tom Lane
Date:
Subject: Re: vacuum analyze hurts performance