Re: Variable length custom data types help

Поиск
Список
Период
Сортировка
От Morgan Kita
Тема Re: Variable length custom data types help
Дата
Msg-id 08B420FF5BF7BC42A064212C2EB7688017E489@neutron.verseon.com
обсуждение исходный текст
Ответ на Variable length custom data types help  ("Morgan Kita" <mkita@verseon.com>)
Список pgsql-novice
I thought about that but I am really not that interested in the individual elements of the array. I am always going to
begrabbing and storing them as entire blocks. 

Thanks,
Morgan

"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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Variable length custom data types help
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: plpgsql question - simple I would have thought