Re: function with unknown params

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: function with unknown params
Дата
Msg-id 1373476911.66245.YahooMailNeo@web162902.mail.bf1.yahoo.com
обсуждение исходный текст
Ответ на Re: function with unknown params  (giozh <giozh@yahoo.it>)
Список pgsql-general
giozh <giozh@yahoo.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


В списке pgsql-general по дате отправления:

Предыдущее
От: Jeff Janes
Дата:
Сообщение: Re: Force ssl connection
Следующее
От: Ketana Patel
Дата:
Сообщение: Re: Removing duplicates