Re: [GENERAL] Postgresql 8.3X supports Arrays of Composite Types?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robson Fidalgo <rdnf(at)cin(dot)ufpe(dot)br>
Cc: pgsql-docs(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Postgresql 8.3X supports Arrays of Composite Types?
Date: 2009-04-19 23:25:32
Message-ID: 12292.1240183532@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-general

Robson Fidalgo <rdnf(at)cin(dot)ufpe(dot)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

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message David Fetter 2009-04-19 23:56:19 Re: [GENERAL] Postgresql 8.3X supports Arrays of Composite Types?
Previous Message Robson Fidalgo 2009-04-19 21:08:18 Re: Postgresql 8.3X supports Arrays of Composite Types?

Browse pgsql-general by date

  From Date Subject
Next Message David Fetter 2009-04-19 23:56:19 Re: [GENERAL] Postgresql 8.3X supports Arrays of Composite Types?
Previous Message aravind chandu 2009-04-19 21:49:32 Problem with pgpool-II tool