Re: [GENERAL] Casting

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [GENERAL] Casting
Дата
Msg-id 26651.1049811939@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: [GENERAL] Casting
Список pgsql-hackers
"Nigel J. Andrews" <nandrews@investsystems.co.uk> writes:
> When I use my cast I get:
> mydb=> select cast('truE'::text as boolean);
> WARNING:  Error occurred while executing PL/pgSQL function text_to_bool
> WARNING:  line 4 at select into variables
> ERROR:  CopyQuerySnapshot: no snapshot has been set

Hmm.  The problem here is that parse_coerce.c thinks it can apply
eval_const_expressions() to simplify the CAST; but in the general case
that doesn't work because the query snapshot may not be set yet.
Had we left the expression to be folded at plan time everything would
be okay.

I dislike removing the optimization altogether, but maybe we don't
have much choice.  Anyone see another way around it?
        regards, tom lane



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

Предыдущее
От: Patrick Welche
Дата:
Сообщение: win32 broke unix
Следующее
От: Jan Wieck
Дата:
Сообщение: Re: Complex database for testing, U.S. Census Tiger/UA