Re: [RFC] Common object property boards

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: [RFC] Common object property boards
Дата
Msg-id CA+Tgmobwq=M6g3BKRcCQqAiCPW5o23eKqDrttORdGihDHTH0+A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [RFC] Common object property boards  (Alvaro Herrera <alvherre@commandprompt.com>)
Ответы Re: [RFC] Common object property boards  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-hackers
On Mon, Aug 1, 2011 at 4:02 PM, Alvaro Herrera
<alvherre@commandprompt.com> wrote:
> Excerpts from Kohei KaiGai's message of dom jul 31 02:21:55 -0400 2011:
>> 2011/7/29 Tom Lane <tgl@sss.pgh.pa.us>:
>
>> > It would likely be better to not expose the struct type, just individual
>> > lookup functions.
>> >
>> If so, individual functions to expose a certain property of the supplied
>> object type should be provided.
>>
>>   int get_object_property_catid_oidlookup(ObjectType);
>>   int get_object_property_catid_namelookup(ObjectType);
>>   Oid get_object_property_relation_id(ObjectType);
>>   AttrNumber get_object_property_nameattnum(ObjectType);
>>   AttrNumber get_object_property_namespacenum(ObjectType);
>>   AttrNumber get_object_property_ownershipnum(ObjectType);
>
> Maybe a single lookup function that receives pointers that the lookup
> routine can fill with the appropriate information; allowing for a NULL
> pointer in each, meaning caller is not interested in that property.

That seems like a lot of extra notational complexity for no particular
benefit.  Every time someone wants to add a new property to this
array, they're going to have to touch every caller, and all
third-party code using this interface will have to be rejiggered.  I
still think that just returning a pointer to the struct is a perfectly
sensible API...

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Compressing the AFTER TRIGGER queue
Следующее
От: David Fetter
Дата:
Сообщение: Re: libedit memory stomp is apparently fixed in OS X Lion