Re: [RFC] Common object property boards - Mailing list pgsql-hackers

From Kohei KaiGai
Subject Re: [RFC] Common object property boards
Date
Msg-id CADyhKSWgDdBLnoQaZ47O=2Ynm_z04TvffpkDzsV_Nv3AX5Q15g@mail.gmail.com
Whole thread Raw
In response to Re: [RFC] Common object property boards  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [RFC] Common object property boards
List pgsql-hackers
2011/8/7 Tom Lane <tgl@sss.pgh.pa.us>:
> Kohei KaiGai <kaigai@kaigai.gr.jp> writes:
>> I'm under implementation of this code according to the suggestion.
>> However, I'm not sure whether it is really portable way (at least, GCC accepts),
>> and whether the interface is simpler than as Robert suggested at first.
>
>> #define get_object_property_attnum_name(objtype)                        \
>>     ({  AttrNumber ____temp;                                            \
>>         get_object_property((objtype), NULL, NULL, NULL, NULL,          \
>>                             &____temp, NULL, NULL);                     \
>>         ____temp; })
>
> Blocks within expressions are a gcc-ism and will fail on any other
> compiler, so you can't do it that way.
>
Thanks for your suggestion.
So, it seems to me the interface should return a pointer to the entry
of array being specified, rather than above approach.

E.g, the above macro could be probably rewritten as follows: #define get_object_property_attnum_name(objtype) \
(get_object_property(objtype)->attnum_name)

--
KaiGai Kohei <kaigai@kaigai.gr.jp>


pgsql-hackers by date:

Previous
From: Shigeru Hanada
Date:
Subject: force_not_null option support for file_fdw
Next
From: Shigeru Hanada
Date:
Subject: Re: per-column FDW options, v5