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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

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: Sun, 19 Apr 2009 19:25:32 -0400
  • Message-id: <12292.1240183532@sss.pgh.pa.us> <text/plain>

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



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group