Re: BUG #2242: Inconsistent casting in query with literal vs query with parameter

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #2242: Inconsistent casting in query with literal vs query with parameter
Дата
Msg-id 6732.1139323769@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #2242: Inconsistent casting in query with literal vs query with parameter  ("Matthew Bellew" <postgres@bellew.net>)
Список pgsql-bugs
"Matthew Bellew" <postgres@bellew.net> writes:
> In the script below, I'd expect all four queries to return 10 rows
> (1,2,3,4,5,10,20,30,40,50).  However, function bystr() returns two rows
> (1,10).  Clearly, in this one case the query processor is casting the column
> to the parameter type, rather than the other way around.  The optimizer
> should always preferentially cast the parameter to the type of the column.

I see no bug here.  You are confused about the difference between an
unknown literal ('100') and a value that is actually declared to be of
type text.  See
http://www.postgresql.org/docs/8.1/static/typeconv.html

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #2245: pg_dump doesn't dump expressions with sequence in DEFAULT setting for some column in table
Следующее
От: "Matej Rizman"
Дата:
Сообщение: BUG #2243: Postgresql fails to finish some queries