Re: [GENERAL] row->ARRAY or row->table casting?

2007-10-01 Thread Nico Sabbi
Gregory Stark ha scritto: "Nico Sabbi" <[EMAIL PROTECTED]> writes: 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 (in

Re: [GENERAL] row->ARRAY or row->table casting?

2007-09-28 Thread Gregory Stark
"Nico Sabbi" <[EMAIL PROTECTED]> writes: > 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 t

Re: [GENERAL] row->ARRAY or row->table casting?

2007-09-28 Thread Nico Sabbi
Tom Lane ha scritto: Nico Sabbi <[EMAIL PROTECTED]> 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)

Re: [GENERAL] row->ARRAY or row->table casting?

2007-09-28 Thread Tom Lane
Nico Sabbi <[EMAIL PROTECTED]> 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

[GENERAL] row->ARRAY or row->table casting?

2007-09-28 Thread Nico Sabbi
Hi, is there any way to cast a generic row to an array or to a table type? The example is trivial, but it explains what I'm trying to do: nb1=# select * from tab1; a | t ---+--- 1 | a 2 | b 3 | c (3 rows) nb1=# select r from (select row(tab1.*) as r from tab1)x; r --- (1,a) (2,b) (3,c) (