Re: Postgresql 8.3X supports Arrays of Composite Types? - Mailing list pgsql-general

From Tom Lane
Subject Re: Postgresql 8.3X supports Arrays of Composite Types?
Date
Msg-id 12292.1240183532@sss.pgh.pa.us
Whole thread Raw
In response to Postgresql 8.3X supports Arrays of Composite Types?  (Robson Fidalgo <rdnf@cin.ufpe.br>)
List pgsql-general
Robson Fidalgo <rdnf@cin.ufpe.br> writes:
> I am using postgresql 8.3X and I created a table (see example below) that
> has an attribute that is an Array of a Composite Type (ROW). However, I do
> not know how can I insert a record in this table.

You need some explicit casts so that the array[] construct is seen to
have the right type, eg

insert into person values ('Joe', array[row('1','1111')::phone, row('2','2222')::phone]);

            regards, tom lane

pgsql-general by date:

Previous
From: Robson Fidalgo
Date:
Subject: Postgresql 8.3X supports Arrays of Composite Types?
Next
From: David Fetter
Date:
Subject: Re: Postgresql 8.3X supports Arrays of Composite Types?