Re: BUG #19033: Inconsistency between prepared statement and normal statement when cast bit to integer

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #19033: Inconsistency between prepared statement and normal statement when cast bit to integer
Дата
Msg-id 1393031.1756306495@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #19033: Inconsistency between prepared statement and normal statement when cast bit to integer  (PG Bug reporting form <noreply@postgresql.org>)
Список pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> PREPARE prepare_query (unknown) AS SELECT $1::INT;
> EXECUTE prepare_query(B'1111');
> ERROR:  parameter $1 of type bit cannot be coerced to the expected type
> integer

The reason that fails is that EvaluateParams uses assignment-coercion
semantics, which is more limited in what it will allow than an
explicit coercion.  I think this is correct behavior.  The system
should not silently perform cross-type-category casts --- too much
risk of unintended results.

            regards, tom lane



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