array of composite types - how can I launch this function with an array of composite values - Mailing list pgsql-novice

From Nikita Koselev
Subject array of composite types - how can I launch this function with an array of composite values
Date
Msg-id 24e54d80810042351l6823473dn2a9465a3a2e8adbd@mail.gmail.com
Whole thread Raw
Responses Re: array of composite types - how can I launch this function with an array of composite values
List pgsql-novice
I have a composite type, like
--
CREATE TYPE requirement_vo AS (
 name VARCHAR(20),
 description VARCHAR(20),
 requirement_id INT,
 requirement_type_id INT,
 priority_id INT,
 necessity_id INT,
 lower_limit DOUBLE PRECISION,
 upper_limit DOUBLE PRECISION
 );
--
and I have a function
--
CREATE OR REPLACE FUNCTION add_position(rs requirement_vo[] )
--


Code like this
--
SELECT * FROM add_position('{("name", "descr", "req_id", "req_type_id",
"priority_id", "nec_id", 2.1321, 1.2323)}');
--
returns "ERROR: malformed array literal: "{("name", "descr", "req_id",
"req_type_id",
"priority_id", "nec_id", 2.1321, 1.2323)}"
SQL state: 22P02
"

So the question is - how can I launch this function with an array of
composite values?
Documentation (http://www.postgresql.org/docs/8.3/interactive/arrays.html)
says "Arrays of ... or composite type can be created."

Nikita Koselev

pgsql-novice by date:

Previous
From: "Harold A. Giménez Ch."
Date:
Subject: Re: Optimizing sum() operations
Next
From: "Nikita Koselev"
Date:
Subject: DESCRIBE for composite type?