Re: Insert value input syntax of an array of types without ARRAY/ROW nor casting?

Поиск
Список
Период
Сортировка
От Vibhor Kumar
Тема Re: Insert value input syntax of an array of types without ARRAY/ROW nor casting?
Дата
Msg-id 43722681-5C87-491B-A310-DF572556721F@enterprisedb.com
обсуждение исходный текст
Ответ на Re: Insert value input syntax of an array of types without ARRAY/ROW nor casting?  (Stefan Keller <sfkeller@gmail.com>)
Список pgsql-general
On Mar 19, 2011, at 9:50 PM, Stefan Keller wrote:

> Unfortunately it still does'nt work. I get
>
> ERROR:  wrong record constant: »('a'«
> LINE 2:  5, $${ ('a', 'aa'), ('b', 'bb') }$$ );
>           ^
> DETAIL:  Unexpected end of line.



Try following, it should work:
INSERT INTO mytypetable VALUES (
6,ARRAY[row('a','aa'), row('b', 'bb')]::mytype[] ); 


Thanks & Regards,
Vibhor Kumar
EnterpriseDB Corporation
The Enterprise PostgreSQL Company
vibhor.kumar@enterprisedb.com
Blog:http://vibhork.blogspot.com


В списке pgsql-general по дате отправления:

Предыдущее
От: Vincent Veyron
Дата:
Сообщение: Re: triggers and FK cascades
Следующее
От: Vibhor Kumar
Дата:
Сообщение: Re: How do I do this in plpgsql ?