Re: BUG #15057: Issue with UNKNOW type when calling a PostgreSQL function from java code

From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: Praveen Kumar <praveenkumar52028(at)gmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15057: Issue with UNKNOW type when calling a PostgreSQL function from java code
Date: 2018-02-10 11:48:17
Message-ID: 87sha9rs41.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

>>>>> "Praveen" == Praveen Kumar <praveenkumar52028(at)gmail(dot)com> writes:

Praveen> [image: Inline image 2]

In future please use text rather than screenshots, so that you can
include the complete list rather than just a small part.

Praveen> While calling one of these DECODE functions from my existing
Praveen> select query,I am seeing an error saying

Praveen> decode(numeric,integer,unknown,unknow) is not available

Because you didn't include the complete list of function signatures in
your message, we're left with the fact that the ones you _did_ show all
start out with anyelement,anyelement. Since polymorphic function
resolution requires all "anyelement" matches to be of the _same_ type,
it's clear that none of these can match a call which has numeric,integer
as the first two parameters.

Even if you changed your second parameter to be numeric rather than
integer, you'd then be faced with the fact that the list of signatures
contains at least these:

decode(anyelement,anyelement,bigint,bigint)
decode(anyelement,anyelement,character,character)
decode(anyelement,anyelement,date,date)

So how would postgres be able to tell, given an argument list with types
(numeric,numeric,unknown,unknown), which of these signatures to use?
Obviously it would be ambiguous.

--
Andrew (irc:RhodiumToad)

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Geoghegan 2018-02-10 22:55:29 Re: BUG #15026: Deadlock using GIST index
Previous Message Pavel Stehule 2018-02-10 11:12:02 Re: BUG #15057: Issue with UNKNOW type when calling a PostgreSQL function from java code