how to insert values into complex type field

Поиск
Список
Период
Сортировка
От windwxc@sina.com
Тема how to insert values into complex type field
Дата
Msg-id 20080404083236.A88EF1EE8E2@mail3-145.sinamail.sina.com.cn
обсуждение исходный текст
Ответы Re: how to insert values into complex type field
Re: how to insert values into complex type field
Список 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 по дате отправления:

Предыдущее
От: "A. Kretschmer"
Дата:
Сообщение: Re: Autograph Annoucement (ERD Tool)
Следующее
От: "William Temperley"
Дата:
Сообщение: Re: Secure "where in(a,b,c)" clause.