Re: Insert value input syntax of an array of types without ARRAY/ROW nor casting? - Mailing list pgsql-general

From Vibhor Kumar
Subject Re: Insert value input syntax of an array of types without ARRAY/ROW nor casting?
Date
Msg-id 43722681-5C87-491B-A310-DF572556721F@enterprisedb.com
Whole thread Raw
In response to Re: Insert value input syntax of an array of types without ARRAY/ROW nor casting?  (Stefan Keller <sfkeller@gmail.com>)
List 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 by date:

Previous
From: Vincent Veyron
Date:
Subject: Re: triggers and FK cascades
Next
From: Vibhor Kumar
Date:
Subject: Re: How do I do this in plpgsql ?