From: Christoph Berg <myon@debian.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Michael Banck <mbanck@gmx.net>
Cc: Tommy Pavlicek <tommypav122@gmail.com>
Cc: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Cc: pgsql-hackers@lists.postgresql.org
Cc: jian.universality@gmail.com
Subject: Re: Better error reporting from extension scripts (Was: Extend ALTER OPERATOR)
Date: Fri, 27 Sep 2024 19:31:19 +0200
Message-ID: <Zvbr5zv78AfhB83S@msg.df7cb.de> (raw)
In-Reply-To: <571930.1727454668@sss.pgh.pa.us>
References: <CAEhP-W_1bMTLan2LtzS+xr=b-Wep56gw+OoirABQ8b2aOw+5yg@mail.gmail.com>
<ZTfL1G1fBPQHVPWV@msg.df7cb.de>
<560086.1698160614@sss.pgh.pa.us>
<ZTfjXzOKFI9AawJF@msg.df7cb.de>
<570833.1698162135@sss.pgh.pa.us>
<66f33840.050a0220.1f9e60.7fb9@mx.google.com>
<ZvV1ClhnbJLCz7Sm@msg.df7cb.de>
<325394.1727365907@sss.pgh.pa.us>
<ZvaiS57G10dITjQm@msg.df7cb.de>
<571930.1727454668@sss.pgh.pa.us>
Re: Tom Lane
> Perhaps. I spent a little more effort on this and added code to
> report errors that don't come with an error location. On those,
> we don't have any constraints about what to report in the QUERY
> field, so I made it trim the string to just the current query
> within the script, which makes things quite a bit better. You
> can see the results in the test_extensions regression test changes.
That looks very good me, thanks!
> (It might be worth some effort to trim away comments appearing
> just before a command, but I didn't tackle that here.)
The "error when psql" comments do look confusing, but I guess in other
places the comment just before the query adds valuable context, so I'd
say leaving the comments in is ok.
Christoph
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-hackers@postgresql.org
Cc: myon@debian.org, tgl@sss.pgh.pa.us, mbanck@gmx.net, tommypav122@gmail.com, ilmari@ilmari.org, pgsql-hackers@lists.postgresql.org, jian.universality@gmail.com
Subject: Re: Better error reporting from extension scripts (Was: Extend ALTER OPERATOR)
In-Reply-To: <Zvbr5zv78AfhB83S@msg.df7cb.de>
* 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