Re: BUG #4120: ERROR: cache lookup failed for function 0

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #4120: ERROR: cache lookup failed for function 0
Дата
Msg-id 608.1208803167@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #4120: ERROR: cache lookup failed for function 0  (Pedro Gimeno <pgsql-002@personal.formauri.es>)
Список pgsql-bugs
Pedro Gimeno <pgsql-002@personal.formauri.es> writes:
> Tom Lane wrote:
> Here's a minimal test case:

> pruebas=# CREATE FUNCTION vc_gt(varchar,varchar) RETURNS boolean
> IMMUTABLE STRICT LANGUAGE SQL AS 'SELECT CAST($1 AS TEXT) > CAST($2 AS
> TEXT);';
> CREATE FUNCTION
> pruebas=# CREATE OPERATOR > (
>             PROCEDURE = vc_gt,
>     LEFTARG = character varying,
>     RIGHTARG = character varying,
>     COMMUTATOR = <,
>     RESTRICT = scalargtsel,
>     JOIN = scalargtjoinsel
> );
> CREATE OPERATOR
> pruebas=# SELECT ''::varchar < ''::varchar;
> ERROR:  cache lookup failed for function 0

Ah.  You have actually created a "shell" operator varchar < varchar
by having written the commutator link.  The error message could be
more helpful, perhaps, but I can't get too excited about it considering
that it's a consequence of a bogus operator definition.  Either provide
the < operator or drop the COMMUTATOR property.

> This was part of my workaround for bug #4083. I only needed MAX so I
> only wrote the > operator. BTW, has #4083 been dismissed?

I don't think we'll do anything about it, no.

            regards, tom lane

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

Предыдущее
От: Pedro Gimeno
Дата:
Сообщение: Re: BUG #4120: ERROR: cache lookup failed for function 0
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #4113: server closed the connection unexpectedly