Re: Variable length custom data types help

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Variable length custom data types help
Дата
Msg-id 28992.1112392846@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Variable length custom data types help  ("Morgan Kita" <mkita@verseon.com>)
Список pgsql-novice
"Morgan Kita" <mkita@verseon.com> writes:
> Just to clarify in the example foo structure below where the first
> member is the length, and then you say /*rest of structure here*/, by
> that do you mean the individual data members of the structure that will
> be in my array of strucs? I guess it can't be a pointer to the array as
> you said postgres will not know that you are storing pointers. If so
> that means you have a bit of wasted overhead right? I think I will just
> try creating the pointer as void*, set the first 4 bytes to the length,
> and then fill in the rest.

BTW, if what you have is actually an *array*, namely N instances of the
same kind of animal, maybe you should define your custom type as just
one of that kind of animal, and let PG provide the array superstructure.
That way you could, for example, subscript the array at the SQL level.

            regards, tom lane

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

Предыдущее
От: "Walker, Jed S"
Дата:
Сообщение: plpgsql question - simple I would have thought
Следующее
От: "Morgan Kita"
Дата:
Сообщение: Re: Variable length custom data types help