Re: function with unknown params

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: giozh <giozh(at)yahoo(dot)it>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: function with unknown params
Date: 2013-07-10 17:21:51
Message-ID: 1373476911.66245.YahooMailNeo@web162902.mail.bf1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

giozh <giozh(at)yahoo(dot)it> wrote:

> ok, it works. But why on error message i had that two unknown
> data type? if was an error on date type, why it don't signal
> that?

Because PostgreSQL treats a quoted literal as being of unknown type
-- each of these could have matched a parameter of any type, and
would have been treated as a literal of the needed type.  On the
other hand, if you match up the parameters of *known* types against
the function's signature, you will see that the fifth parameter is
declared to be a date, but the value you supplied is an integer --
because 22 divided by 1 divided by 2013 evaluates to an integer of
zero.  Since there can be many different functions with any given
name, with different parameter types, it doesn't try to match up
parameters and guess which one might be the wrong type -- for all
it knows the problem is that there's a missing function with a
signature compatible with the values you specified.  It tells you
the types it sees.

--
Kevin Grittner
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ketana Patel 2013-07-10 18:04:48 Re: Removing duplicates
Previous Message Jeff Janes 2013-07-10 16:58:24 Re: Force ssl connection