Re: [SQL] how to get more detailed error messages? - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: [SQL] how to get more detailed error messages?
Date
Msg-id 20020412140503.7786ee3a.alvherre@atentus.com
Whole thread Raw
In response to Re: [SQL] how to get more detailed error messages?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
En Fri, 12 Apr 2002 13:40:06 -0400
Tom Lane <tgl@sss.pgh.pa.us> escribió:

> Markus Wagner <wagner@imsd.uni-mainz.de> writes:

> > When executing the code we get an error message "ERROR:  UNION types "text"
> > and "int4" not matched" with only the line number of the terminating
> > semicolon included.
>
> > Isn't there a way to get the parser to talk more precisely???

[...]

> I have occasionally toyed with the idea of labeling querytree elements
> with back-pointers showing the segment of source text that they came
> from, but AFAICT this would impose a nontrivial cost on parsing activity
> --- a cost that'd be paid all the time, even on correct queries.  Not
> sure if it'd be a net benefit or not.

Is there a way to tell the parser to only include those backpointer on
demand (say, set them to NULL unless explicitly told to do the
backreference)? That way, correct queries do not have to pay the price,
but there is a way to debug a query if one wants to. Say,

DEBUG <sql-stmt>

or something like that (just like EXPLAIN etc).

--
Alvaro Herrera (<alvherre[a]atentus.com>)
"El destino baraja y nosotros jugamos" (A. Schopenhauer)

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: [SQL] how to get more detailed error messages?
Next
From: Devrim GUNDUZ
Date:
Subject: Permissions on columns: in todo list??