Re: array variables - Mailing list pgsql-sql

FromPavel Stehule
SubjectRe: array variables
Date
Msg-id[email protected]
Whole thread Raw
In response toRe: array variables  (Tom Lane <[email protected]>)
Listpgsql-sql
2008/11/13 Tom Lane <[email protected]>:
> "Pavel Stehule" <[email protected]> writes:
>> 2008/11/13 Tom Lane <[email protected]>:
>>> My example was done in 8.3.
>
>> I tested it with error:
>
>> postgres=# select array(select row(a,b) from f);
>> ERROR:  could not find array type for datatype record
>
> You left out the cast to a named rowtype --- that's not optional,
> unfortunately.
>

it works on devel

[pavel@localhost pgsql]$ psql postgres
\psql (8.4devel)
Type "help" for help.

postgres=# create table foo(a int, b varchar);
CREATE TABLE
postgres=# insert into foo values(10, 'kuku'),(20,'aba');
INSERT 0 2
postgres=# select array(select row(a,b) from foo);        ?column?
--------------------------{"(10,kuku)","(20,aba)"}
(1 row)

regards
Pavel Stehule

>                        regards, tom lane
>


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: array variables
Next
From: "Sabin Coanda"
Date:
Subject: uuid on windows