Re: TR: Like and =

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: TR: Like and =
Дата
Msg-id 2063.1056389739@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: TR: Like and =  (Randall Lucas <rlucas@tercent.net>)
Список pgsql-sql
Randall Lucas <rlucas@tercent.net> writes:
> The LIKE operator takes a pattern, and since your pattern did not 
> specify a wildcard at the end, it didn't exactly match the padded 
> string.

> This behavior does seem kind of confusing; 

Yeah.  As of CVS tip, the system is actually going out of its way to
cause this to happen: if we deleted the separate ~~ operator for bpchar,
then the automatic rtrim() that now happens when converting bpchar to
text would cause the extra spaces to go away, and the LIKE would work
as Nicolas is expecting.  On the other hand, this would probably create
some backwards-compatibility issues, since existing uses of LIKE with
bpchar operands are no doubt using patterns that expect the spaces to be
there.  Any opinions whether we should change it or not?
        regards, tom lane


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

Предыдущее
От: Michael A Nachbaur
Дата:
Сообщение: Re: multi-table unique index
Следующее
От: Markus Bertheau
Дата:
Сообщение: Re: multi-table unique index