Re: tightening up on use of oid 0 - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: tightening up on use of oid 0
Date
Msg-id 416CC3F2.3010003@opencloud.com
Whole thread Raw
In response to Re: tightening up on use of oid 0  (Kris Jurka <books@ejurka.com>)
List pgsql-jdbc
Kris Jurka wrote:

> I was testing this out a little and this doesn't produce the error I
> expected:
>
> CREATE FUNCTION g(int) RETURNS int AS 'SELECT 1;' LANGUAGE sql;
> CREATE FUNCTION g(float) RETURNS int AS 'SELECT 2;' LANGUAGE sql;
> SELECT g(NULL);

I think implicit casting is interfering here somehow.

With types that don't have implicit casts, you get ambiguity:

>> test=> CREATE FUNCTION h(line) RETURNS int AS 'SELECT 1;' LANGUAGE sql;
>> CREATE FUNCTION
>> test=> CREATE FUNCTION h(point) RETURNS int AS 'SELECT 2;' LANGUAGE sql;
>> CREATE FUNCTION
>> test=> SELECT h(NULL);
>> ERROR:  function h("unknown") is not unique
>> HINT:  Could not choose a best candidate function. You may need to add explicit type casts.

-O

pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: tightening up on use of oid 0
Next
From: Oliver Jowett
Date:
Subject: Re: tightening up on use of oid 0