Received: from cm-lcon-46-187.cm.vtr.net (cm-lcon-46-187.cm.vtr.net [200.83.46.187]) by postgresql.org (Postfix) with ESMTP id 07457475892 for ; Fri, 12 Apr 2002 14:05:18 -0400 (EDT) Received: from cm-lcon-46-187.cm.vtr.net (localhost.localdomain [127.0.0.1]) by cm-lcon-46-187.cm.vtr.net (Postfix) with SMTP id C2F64244; Fri, 12 Apr 2002 14:05:03 -0400 (CLT) Date: Fri, 12 Apr 2002 14:05:03 -0400 From: Alvaro Herrera To: Tom Lane Cc: PgSQL general Subject: Re: [SQL] how to get more detailed error messages? Message-Id: <20020412140503.7786ee3a.alvherre@atentus.com> In-Reply-To: <28259.1018633206@sss.pgh.pa.us> References: <0204120904101G.28384@magnus> <28259.1018633206@sss.pgh.pa.us> Organization: Atentus.com X-Mailer: Sylpheed version 0.7.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Archive-Number: 200204/508 X-Sequence-Number: 23223 En Fri, 12 Apr 2002 13:40:06 -0400 Tom Lane escribió: > Markus Wagner 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 or something like that (just like EXPLAIN etc). -- Alvaro Herrera () "El destino baraja y nosotros jugamos" (A. Schopenhauer)