Skip site navigation (1) Skip section navigation (2)

Attaching error cursor position to invalid constant values

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Attaching error cursor position to invalid constant values
Date: 2008-08-30 20:18:57
Message-ID: 11413.1220127537@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
I'm fooling around with getting the parser to report an error cursor
location if input conversion fails for a constant in a SQL command.
For instance:

regression=# select 42 = 'foo';
ERROR:  invalid input syntax for integer: "foo"
LINE 1: select 42 = 'foo';
                    ^
regression=# select '2000-jax-01'::date;
ERROR:  invalid input syntax for type date: "2000-jax-01"
LINE 1: select '2000-jax-01'::date;
               ^
regression=# 

This seems like it'd be a pretty useful thing to have in long queries,
but in short queries it looks a bit like overkill.  And it affects
the expected output of a whole lot of the regression tests.

Does anyone think this might be "too chatty"?

			regards, tom lane

Responses

pgsql-hackers by date

Next:From: David RowleyDate: 2008-08-30 23:21:11
Subject: TODO item: Implement Boyer-Moore searching (First time hacker)
Previous:From: Tom LaneDate: 2008-08-30 15:51:49
Subject: Re: Is it really such a good thing for newNode() to be a macro?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group