Re: citext operator precedence fix

Поиск
Список
Период
Сортировка
От David E. Wheeler
Тема Re: citext operator precedence fix
Дата
Msg-id C3AA4F41-074B-4907-9A66-64A0BD7E934A@kineticode.com
обсуждение исходный текст
Ответ на Re: citext operator precedence fix  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: citext operator precedence fix
Список pgsql-hackers
On Sep 21, 2011, at 6:12 PM, Tom Lane wrote:

>> Any idea of how to test for that?  What kind of situations would make
>> things difficult for the parser?
>
> Not sure, but it would be underspecified cases such as 'x' = 'x' that
> might have trouble.  I may be worrying over nothing --- I'm just trying
> to point out some trouble spots you'd better watch for while messing
> with this.

Right, we'd need to make sure that 'x' = 'x' resolves to 'x'::text = 'x'::text. Josh, I think the issue Tom is raising
issomething I've seen when there are multiple functions that could be correct for a given call. For example: 
   select citext_eq('x', 'x'::citext);

If you have these functions:

1. citext_eq(citext,citext)
2. citext_eq(text,citext)
3. citext_eq(citext,text)

Then the question is: does it find only #2 via polymorphic lookup, or does it think that either #1 or #2 could work
(becausetext supports an implicit cast to citext, IIRC). If it's more than one it's an error. Not sure if the same
issueexists for operators. 

This is easy to test for, however, so we'll soon know if there's an issue.

Best,

David

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: [v9.2] make_greater_string() does not return a string in some cases
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [v9.2] make_greater_string() does not return a string in some cases