Re: BUG #17916: Expression IN list translates to unqualified operator

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #17916: Expression IN list translates to unqualified operator
Дата
Msg-id 2956974.1683121244@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #17916: Expression IN list translates to unqualified operator  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #17916: Expression IN list translates to unqualified operator  (RekGRpth <rekgrpth@gmail.com>)
Список pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> create operator qwe.= (leftarg = char, rightarg = text, function =
> qwe.chartexteq, commutator = operator(qwe.=), hashes, merges);
> set search_path = qwe;
> explain (costs off, verbose on) select i from generate_series(1, 10) i where
> i::char in (2::text);

> I expected, that IN list translates to pg_catalog.=

Why would you expect that?  It'd make it impossible to use IN
with user-defined data types.  In this case, you made an operator
that is a closer match to the given datatypes (ie, "char = text")
than the native "text = text" operator, so it used that one.

I've not checked the code, but my recollection is that X IN (Y) just
resolves to the same equality operator you'd get by writing X = Y.
There's been some discussion about allowing a schema qualifier to
be included in the syntax, but nothing's been done about that.

            regards, tom lane



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

Предыдущее
От: Stan S
Дата:
Сообщение: Re: BUG #17914: walsenders taking up all memory
Следующее
От: RekGRpth
Дата:
Сообщение: Re: BUG #17916: Expression IN list translates to unqualified operator