Re: Calling overloaded function with NULL argument - Mailing list pgsql-general

From Tom Lane
Subject Re: Calling overloaded function with NULL argument
Date
Msg-id 24093.1234215520@sss.pgh.pa.us
Whole thread Raw
In response to Calling overloaded function with NULL argument  (Patryk Kordylewski <pk@fooby.de>)
List pgsql-general
Patryk Kordylewski <pk@fooby.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

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: Out of memory on SELECT in 8.3.5
Next
From: "Matt Magoffin"
Date:
Subject: Re: Out of memory on SELECT in 8.3.5