pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jan Wieck <JanWieck@yahoo.com>
Cc: Richard Huxton <dev@archonet.com>
Cc: Bruno Boettcher <bboett@erm1.u-strasbg.fr>
Cc: pgsql-sql@postgresql.org
Subject: Re: HELP: what's wrong with my PL/PSQL function??
Date: Mon, 21 May 2001 10:16:45 -0400
Message-ID: <25030.990454605@sss.pgh.pa.us> (raw)
In-Reply-To: <200105211248.IAA01695@jupiter.jw.home>
References: <200105211248.IAA01695@jupiter.jw.home>

Jan Wieck <JanWieck@yahoo.com> writes:
> Tom Lane wrote:
>> I am not sure why this precious info is so deeply buried.  I know why
>> it's not part of the ERROR itself: our elog mechanism doesn't support
>> that.  But seems like it could at least be made a NOTICE rather than a
>> DEBUG message.

>     Because  at  the  time  the  NOTICE  will be sent, the client
>     already  received  the  ERROR  and  doesn't  read  from   the
>     connection until the next command.  So at least you'd have to
>     send an empty query to get it.

Au contraire.  To test this, I changed elog(DEBUG)s to elog(NOTICE)s
in pl_exec.c, and now I get:

regression=# select zz();
NOTICE:  Last error occured while executing PL/pgSQL function zz
NOTICE:  line 2 at SQL statement
ERROR:  parser: parse error at or near "x"
regression=#

The reason is that libpq doesn't report query done until it gets the
trailing 'Z' (ReadyForQuery) message, and the notices will come out
before that.

You might need to reword the notices a bit because they will appear
before the error itself, but this still seems to me a lot better than
having to go digging in the postmaster log (if there is one).

			regards, tom lane



view thread (5+ messages)

Message-ID: <25030.990454605@sss.pgh.pa.us>
Permalink:  ../25030.990454605@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/25030.990454605@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, JanWieck@yahoo.com, dev@archonet.com, bboett@erm1.u-strasbg.fr
  Subject: Re: HELP: what's wrong with my PL/PSQL function??
  In-Reply-To: <25030.990454605@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox