From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@commandprompt.com>
Cc: Michael Glaesemann <grzm@myrealbox.com>
Cc: pgsql-patches@postgresql.org
Cc: pgsql-interfaces@postgresql.org
Subject: Re: [PATCHES] Proposed p.tch for error locations
Date: Mon, 13 Mar 2006 16:28:38 -0500
Message-ID: <10458.1142285318@sss.pgh.pa.us> (raw)
In-Reply-To: <20060313153209.GA15002@surnet.cl>
References: <5114.1142185055@sss.pgh.pa.us>
<C3817205-17E1-4D6C-9D92-ED6045123F92@myrealbox.com>
<7274.1142262691@sss.pgh.pa.us>
<20060313153209.GA15002@surnet.cl>
I took another look at this and realized that for PQerrorMessage to emit
a cursor-pointer line, it'd be necessary for libpq to hold onto a copy
of the query last sent, which it doesn't do presently. This is annoying
for long queries --- in the worst case it could provoke out-of-memory
failures that don't occur now.
Plan B would be for psql to stop using PQerrorMessage and generate the
message report text from the message fields, omitting "at character N".
This would require duplicating a couple dozen lines from inside libpq.
It'd also mean that the report text gets built twice, once inside libpq
and once by psql, which is probably not such a big deal since error
messages ought not be a performance-critical path ... except there's
still that little question of overrunning memory.
Plan C is just to drop the "at character N" string from what
PQerrorMessage generates. We could make this configurable (maybe via
additional PGVerbosity values), or just not worry about whether it's
important.
Thoughts?
regards, tom lane
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-interfaces@postgresql.org
Cc: tgl@sss.pgh.pa.us, alvherre@commandprompt.com, grzm@myrealbox.com, pgsql-patches@postgresql.org
Subject: Re: [PATCHES] Proposed p.tch for error locations
In-Reply-To: <10458.1142285318@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