Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-docspgsql-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

pgsql-docs by date

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

pgsql-general by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group