array of composite types - how can I launch this function with an array of composite values

Поиск
Список
Период
Сортировка
От Nikita Koselev
Тема array of composite types - how can I launch this function with an array of composite values
Дата
Msg-id 24e54d80810042351l6823473dn2a9465a3a2e8adbd@mail.gmail.com
обсуждение исходный текст
Ответы Re: array of composite types - how can I launch this function with an array of composite values  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: "Harold A. Giménez Ch."
Дата:
Сообщение: Re: Optimizing sum() operations
Следующее
От: "Nikita Koselev"
Дата:
Сообщение: DESCRIBE for composite type?