Re: row->ARRAY or row->table casting?

Поиск
Список
Период
Сортировка
От Nico Sabbi
Тема Re: row->ARRAY or row->table casting?
Дата
Msg-id 46FD3190.8010001@officinedigitali.it
обсуждение исходный текст
Ответ на Re: row->ARRAY or row->table casting?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: row->ARRAY or row->table casting?  (Gregory Stark <stark@enterprisedb.com>)
Список pgsql-general
Tom Lane ha scritto:
> Nico Sabbi <nsabbi@officinedigitali.it> writes:
>
>> is there any way to cast a generic row to an array or to a table type?
>>
>
> "row(...)::composite_type" should work in 8.2 and up.
>
>             regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faq
>
>
I'm using 8.2.4.

What's the right syntax for a case like this?

nb1=# select r.a from (select row(tab1.*)::tab1 as r from tab1)x;
ERROR:  missing FROM-clause entry for table "r"
LINE 1: select r.a from (select row(tab1.*)::tab1 as r from tab1)x;
               ^

I tried many variations (including casting x as tab1) obtaining only
syntax errors.

Thanks,
    Nico

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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: more problems with count(*) on large table
Следующее
От: Scott Ribe
Дата:
Сообщение: Triggers & inheritance