Hello,I have a composite datatype abc which has two integer fields x,y.I have a table Test which has an array of abc.I am trying to populate Test. Triedinsert into test values (ARRAY[abc(1,2)]); but got error
ERROR: function abc(integer, integer) does not existIs there anyway for doing this?
I think you need to use row() and explicit type cast.
postgres=# create type abc as (x integer, y integer);
CREATE TYPE
postgres=# create table foo(val abc[]);
CREATE TABLE
postgres=# insert into foo values (array[row(1,2)::abc]);
INSERT 0 1
postgres=# insert into foo values (array[row('1','2')::abc]);
INSERT 0 1
postgres=# select * from foo ;
val
-----------
{"(1,2)"}
{"(1,2)"}
(2 rows)