Re: [RFC] Common object property boards

From: Kohei KaiGai <kaigai(at)kaigai(dot)gr(dot)jp>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Kohei Kaigai <kohei(dot)kaigai(at)emea(dot)nec(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [RFC] Common object property boards
Date: 2011-08-08 07:12:20
Message-ID: CADyhKSWgDdBLnoQaZ47O=2Ynm_z04TvffpkDzsV_Nv3AX5Q15g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2011/8/7 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Kohei KaiGai <kaigai(at)kaigai(dot)gr(dot)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(at)kaigai(dot)gr(dot)jp>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Shigeru Hanada 2011-08-08 07:14:26 force_not_null option support for file_fdw
Previous Message Shigeru Hanada 2011-08-08 06:13:47 Re: per-column FDW options, v5