Re: [GENERAL] Casting

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [GENERAL] Casting
Date: 2003-04-08 14:25:39
Message-ID: 26651.1049811939@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

"Nigel J. Andrews" <nandrews(at)investsystems(dot)co(dot)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

In response to

  • Casting at 2003-04-08 09:04:30 from Nigel J. Andrews

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Baguette 2003-04-08 15:01:35 How can I indicate the readline location ???
Previous Message Jim C. Nasby 2003-04-08 14:13:31 Re: Optimizer not using index on 120M row table

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 2003-04-08 14:32:52 Re: Complex database for testing, U.S. Census Tiger/UA
Previous Message Patrick Welche 2003-04-08 14:22:25 win32 broke unix