Re: [SQL] how to get more detailed error messages?

From: Alvaro Herrera <alvherre(at)atentus(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PgSQL general <pgsql-general(at)postgresql(dot)org>
Subject: Re: [SQL] how to get more detailed error messages?
Date: 2002-04-12 18:05:03
Message-ID: 20020412140503.7786ee3a.alvherre@atentus.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

En Fri, 12 Apr 2002 13:40:06 -0400
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> escribió:

> Markus Wagner <wagner(at)imsd(dot)uni-mainz(dot)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)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Devrim GUNDUZ 2002-04-12 18:10:57 Permissions on columns: in todo list??
Previous Message Tom Lane 2002-04-12 17:40:06 Re: [SQL] how to get more detailed error messages?

Browse pgsql-sql by date

  From Date Subject
Next Message Jan Wieck 2002-04-12 18:07:32 Re: Functions in Postgres
Previous Message Tom Lane 2002-04-12 17:40:06 Re: [SQL] how to get more detailed error messages?