Есть следующие типы:
CREATE TYPE _goods_item AS (goods_id bigint, point_id bigint, quantity integer, volume integer, is_perishable boolean);
CREATE TYPE _distance_item AS (point_id bigint, distance integer);
CREATE TYPE _point_item AS (point_id bigint, point_type bigint, distances _distance_item[]);
Есть функция:
CREATE OR REPLACE FUNCTION _generate( goods_item _goods_item[], point_item _point_item[] ) RETURNS SETOF integer AS '$pg', '_generate' LANGUAGE C STRICT STABLE;
Как ее правильно вызвать?
Для
CREATE OR REPLACE FUNCTION _generate2( goods_item _goods_item[], point_item _distance_item[] ) RETURNS SETOF integer AS 'pg', '_generate2' LANGUAGE C STRICT STABLE;
Вызов выглядит так:
select _generate2('{"(1,3,3,9,false)", "(10,30,30,90,false)"}'::_goods_item[], '{"(22,332)", "(243,24323)", "(243,24323)"}'::_distance_item[]);