Search Postgresql Archives

Re: function with unknown params

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



giozh <giozh@xxxxxxxx> 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


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux