Re: [RFC] Common object property boards

Поиск
Список
Период
Сортировка
От Kohei KaiGai
Тема Re: [RFC] Common object property boards
Дата
Msg-id CADyhKSWgDdBLnoQaZ47O=2Ynm_z04TvffpkDzsV_Nv3AX5Q15g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [RFC] Common object property boards  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [RFC] Common object property boards  (Alvaro Herrera <alvherre@commandprompt.com>)
Список 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 по дате отправления:

Предыдущее
От: Shigeru Hanada
Дата:
Сообщение: force_not_null option support for file_fdw
Следующее
От: Shigeru Hanada
Дата:
Сообщение: Re: per-column FDW options, v5