pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Tom Lane <tgl@sss.pgh.pa.us>
To: jian he <jian.universality@gmail.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Christoph Berg <myon@debian.org>
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
Subject: Re: Better error reporting from extension scripts (Was: Extend ALTER OPERATOR)
Date: Wed, 16 Oct 2024 14:17:58 -0400
Message-ID: <204604.1729102678@sss.pgh.pa.us> (raw )
In-Reply-To: <CACJufxFzkf8K69OcpstiCseavcS9yEYrB3=c_J_Jn8wENBsXYA@mail.gmail.com >
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 >
<Zvbr5zv78AfhB83S@msg.df7cb.de >
<621972.1727459684@sss.pgh.pa.us >
<1092841.1727552736@sss.pgh.pa.us >
<2245576.1728418678@sss.pgh.pa.us >
<CACJufxEhaR4Tj0gLvVnRuY_Vs=BqY6LbyMZo_0acnKOdnp5ROQ@mail.gmail.com >
<CAFj8pRALVX8XDY9uZz_JCqd8k5VQjMLk3eGc=STonhMvJoLCSw@mail.gmail.com >
<3482022.1728839631@sss.pgh.pa.us >
<CACJufxGBmvy=Z_8stp-YOnbWXWEEEi5CVeSPy49Ex=gDpyoX=w@mail.gmail.com >
<3748500.1728924327@sss.pgh.pa.us >
<CACJufxFzkf8K69OcpstiCseavcS9yEYrB3=c_J_Jn8wENBsXYA@mail.gmail.com >
jian he <jian.universality@gmail.com> writes:
> just found out the"elog(INFO, "should not reached here");" part never reached.
You didn't check any of the cases we were discussing I guess?
(That is, places in gram.y that throw an error without a
parser_errposition call.)
Note that even if we fix all of those and keep them fixed, we still
couldn't assume the case is unreachable, because gram.y isn't
self-contained. For instance, if we hit out-of-memory during raw
parsing, the OOM error out of mcxt.c isn't going to provide a syntax
error position. I'm not too concerned about doing better than what
the patch does now (i.e. nothing) in such edge cases, but we can't
do worse.
> i guess, we don't need performance in script_error_callback,
> but in script_error_callback arrange code seperate syntax error(raw
> parser) and other error seems good.
> please check the attached minor refactor.
I do not think that's an improvement. It's more complicated and
less readable, and I don't see why we need to squeeze more
performance out of this error-reporting path that should never
be taken in production.
regards, tom lane
view thread (27+ messages) latest in thread
Message-ID: <204604.1729102678@sss.pgh.pa.us>
Permalink: ../204604.1729102678@sss.pgh.pa.us/
Also on: postgresql.org/message-id/204604.1729102678@sss.pgh.pa.us
copy link · copy postgr.es
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-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, jian.universality@gmail.com, pavel.stehule@gmail.com, myon@debian.org, mbanck@gmx.net, tommypav122@gmail.com, ilmari@ilmari.org, pgsql-hackers@lists.postgresql.org
Subject: Re: Better error reporting from extension scripts (Was: Extend ALTER OPERATOR)
In-Reply-To: <204604.1729102678@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