Pavel Stehule wrote:
CREATE FUNCTION foo(date, date, INTEGER[]) RETURNS INTEGER

Array and array's functions works fine, but I need call this function with empty array. I can't use array constructor for empty array. When I call function foo with e.a. ,I get syntax error. I can call with '{}'.

Are you running 7.4beta?



I am sorry, yes, of course :->, testdb=> SELECT version(); version --------------------------------------------------------------------------- PostgreSQL 7.4beta1 on i586-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2.2

You haven't shown us your function or how you're trying to call it. In any case, works here:

regression=# CREATE FUNCTION foo(INTEGER[], INTEGER) RETURNS INTEGER AS
'select ss.f[1] from (select $1 || $2 as f) as ss' language sql;
CREATE FUNCTION
regression=# select foo('{}'::int4[], 3);
  foo
-----
    3
(1 row)

Joe




---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Reply via email to