You need a function like this :
CREATE OR REPLACE FUNCTION array_srf( integer[] ) RETURNS SETOF integer
LANGUAGE PLPGSQL etc... AS
$$
DECLARE
_data ALIAS FOR $1;
_i INTEGER;
BEGIN
FOR _i IN 1..icount(_data) LOOP
RETURN NEXT _data[_i];
Luca Pireddu wrote:
Hello all. I'd like to write a query does a set subtraction A - B, but A is
is a set of constants that I need to provide in the query as immediate
values. I thought of something like
select a from (1,2,3.4)
except
select col_name from table;
richardh=> SELECT * FROM foo;
a
Hello all. I'd like to write a query does a set subtraction A - B, but A is
is a set of constants that I need to provide in the query as immediate
values. I thought of something like
select a from (1,2,3.4)
except
select col_name from table;
but I don't know the syntax to specify my set of co