how to insert values into complex type field - Mailing list pgsql-general

From windwxc@sina.com
Subject how to insert values into complex type field
Date
Msg-id 20080404083236.A88EF1EE8E2@mail3-145.sinamail.sina.com.cn
Whole thread Raw
Responses Re: how to insert values into complex type field  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Re: how to insert values into complex type field  (Stephane Bortzmeyer <bortzmeyer@nic.fr>)
List pgsql-general

hi all, i want to know how to insert values into the field which is a complex type. In fact it is a complex type which also include a complex type. The following is its definition:

create TYPE lifetime as( strattime date, endtime date);

create TYPE attributetype as( ID numeric, address character(50), periodspan lifetime);

create TABLE attribute2005( gid serial, allfield attributetype);

now i want to insert data into the table attribute2005 but always failure so wish someone can help.

my sql is following:

INSERT INTO attribute2005 VALUES(1,(23,'ee','ttt',('2005-01-01','2005-12-31')));

my postgresql is 8.2 and is installed in windows XP.

thank you!

                                                                                      xiaochun wu

-------------------------------------------------------------------
外企高薪职位急聘( http://d1.sina.com.cn/sina/limeng3/mail_zhuiyu/2008/mail_zhuiyu_20080331.html )

-------------------------------------------------------------------
注册新浪2G免费邮箱(http://mail.sina.com.cn/

pgsql-general by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re: Autograph Annoucement (ERD Tool)
Next
From: "William Temperley"
Date:
Subject: Re: Secure "where in(a,b,c)" clause.