Re: Simple row serialization?

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: Simple row serialization?
Дата
Msg-id 162867790801261045r2d0a68c4l842801a4dbbd1e78@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Simple row serialization?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Simple row serialization?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 26/01/2008, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Ivan Voras <ivoras@freebsd.org> writes:
> > Andrew Dunstan wrote:
> >> Or you could possibly use some of the XML support in 8.3 for serialization.
>
> > I need this for 8.1 :)
>
> There's an even easier way in 8.3: just cast the rowtype to text.
>
> regression=# select row(1,2,false)::text;
>    row
> ---------
>  (1,2,f)
> (1 row)
>
> Although this won't work at the SQL level in 8.1, I think you might be
> able to accomplish the equivalent within plpgsql by assigning the
> rowtype value to a text variable.
>

you lost names :(. The best of will be support some like dictionary

so select ((row(1,2,3))::sometype)
{{a:1},{b:2},{c:3}}

Regards
Pavel Stehule

>                         regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>        choose an index scan if your joining column's datatypes do not
>        match
>


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Simple row serialization?
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: Truncate Triggers