Re: user defined types and strings

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: user defined types and strings
Дата
Msg-id 23431.1109202223@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: user defined types and strings  (Kjetil Haaland <kjetil.haaland@student.uib.no>)
Список pgsql-novice
Kjetil Haaland <kjetil.haaland@student.uib.no> writes:
> On Wednesday 23 February 2005 18:23, Michael Fuhr wrote:
>> Hmmm...haven't we already had this conversation? :-)

> We have had almost the same conversation before. The type works in my
> functions, but since the string is just a pointer to a memory place it goes
> away when the type is stored in tables in the database.

The point here is that you've built a two-part structure:

    <length> <pointer to string> <some other fields>
                    |
                    +------------> text of string

and this is fundamentally not going to work.  A datum has to be one
piece of memory.  Consider something like

    <length> <some other fields> <text of string>

where the length is now variable.

            regards, tom lane

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

Предыдущее
От: George Weaver
Дата:
Сообщение: Re: shutdown postmaster question
Следующее
От: Thomas Hallgren
Дата:
Сообщение: Re: Question on TRUNCATE privleges