Re: tightening up on use of oid 0

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: tightening up on use of oid 0
Дата
Msg-id 416CC3F2.3010003@opencloud.com
обсуждение исходный текст
Ответ на Re: tightening up on use of oid 0  (Kris Jurka <books@ejurka.com>)
Список pgsql-jdbc
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

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

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: tightening up on use of oid 0
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: tightening up on use of oid 0