Re: [HACKERS] array constructor can't construct empty array

2003-09-02 Thread Joe Conway
I can select foo('{}'::int4[]) -- ok select foo('{}') -- ok too but select foo(array[]) -- syntax error, my function can by like Correct -- you cannot use the ARRAY constructor empty. If you need an empty array, use '{}'. Search the archives for previous discussions on this t

Re: [HACKERS] array constructor can't construct empty array

2003-09-02 Thread Pavel Stehule
On Mon, 1 Sep 2003, jconway wrote: > > 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 >

Re: [HACKERS] array constructor can't construct empty array

2003-09-01 Thread Tom Lane
Pavel Stehule <[EMAIL PROTECTED]> writes: > 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. Yeah. We have not figured out how to assign a type to "ARRAY[]". You can do something like '{}'::integer[], however

Re: [HACKERS] array constructor can't construct empty array

2003-09-01 Thread jconway
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 '{}'. Ar

Re: [HACKERS] array constructor can't construct empty array

2003-09-01 Thread Pavel Stehule
On Mon, 1 Sep 2003, Bruce Momjian wrote: > Pavel Stehule wrote: > > Hello > > > > I have function > > > > 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 construc

Re: [HACKERS] array constructor can't construct empty array

2003-09-01 Thread Bruce Momjian
Pavel Stehule wrote: > Hello > > I have function > > 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

[HACKERS] array constructor can't construct empty array

2003-09-01 Thread Pavel Stehule
Hello I have function 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 '{}'