X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4450732B4C4 for ; Wed, 13 Oct 2004 06:58:22 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 51227-02 for ; Wed, 13 Oct 2004 05:58:17 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id C897732B4AC for ; Wed, 13 Oct 2004 06:58:17 +0100 (BST) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=opencloud.com) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1CHc9N-0004JF-00; Wed, 13 Oct 2004 18:58:13 +1300 Message-ID: <416CC3F2.3010003@opencloud.com> Date: Wed, 13 Oct 2004 18:58:10 +1300 From: Oliver Jowett User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kris Jurka Cc: "pgsql-jdbc@postgresql.org" Subject: Re: tightening up on use of oid 0 References: <41660A56.5000107@opencloud.com> <4167BC1A.4070809@opencloud.com> <416C3E22.9080605@opencloud.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.3 tagged_above=0.0 required=5.0 tests=UPPERCASE_25_50 X-Spam-Level: X-Archive-Number: 200410/116 X-Sequence-Number: 11221 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