Re: Calling overloaded function with NULL argument

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Patryk Kordylewski <pk(at)fooby(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Calling overloaded function with NULL argument
Date: 2009-02-09 21:38:40
Message-ID: 24093.1234215520@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Patryk Kordylewski <pk(at)fooby(dot)de> writes:
> i've found a strange behaviour when you have overloaded functions with
> the same name and different argument types and try to call them with NULL.
> The stored procedures with "text" and "text[]" argument type gets called
> - the variants with "integer" / "integer[]" produce the, i think
> expected, behaviour and raise an exception "ERROR: FUNCTION
> foo(unknown) IS NOT UNIQUE".

Yeah, this is expected. There's a weak preference to resolve NULL as
text if there's no other way to determine its type. (It's handled the
same as an undecorated string literal.)

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Matt Magoffin 2009-02-09 21:40:12 Re: Out of memory on SELECT in 8.3.5
Previous Message Scott Marlowe 2009-02-09 21:35:20 Re: Out of memory on SELECT in 8.3.5