Re: current_schema will not use an text index ?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: current_schema will not use an text index ?
Дата
Msg-id 1584998.1642951002@sss.pgh.pa.us
обсуждение исходный текст
Ответ на current_schema will not use an text index ?  (Marcos Pegoraro <marcos@f10.com.br>)
Список pgsql-hackers
Marcos Pegoraro <marcos@f10.com.br> writes:
> customer_schema text, --here is the problem, a text column.

> Until version 11 my select was using that index correctly. Then I´ve
> upgraded to 14.1, then ...

> explain analyze select customer_schema, pk from audit where customer_schema
> = current_schema and table_name =

"current_schema" is nowadays considered to have C collation, which is
appropriate for comparisons to columns in the system catalogs.  But that
causes your "customer_schema = current_schema" comparison to resolve as
having C input collation, which doesn't match the collation of your index
on customer_schema.  You could either change the query to look like

where customer_schema = current_schema collate "default" and ...

or else change the table so that customer_schema has "C" collation.

The reason the behavior changed is that we're less cavalier about
the collation of type "name" than we used to be.

            regards, tom lane



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

Предыдущее
От: Julien Rouhaud
Дата:
Сообщение: Re: Schema variables - new implementation for Postgres 15
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Warning in geqo_main.c from clang 13