From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Inconsistency in plpgsql's error context reports
Date: Wed, 13 Dec 2017 14:50:40 -0500
Message-ID: <7449.1513194640@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmoZBd3F0jkw0mvtAKm2OgJR=HL-aqtr5pFVhrVjH2M=XMA@mail.gmail.com>
References: <31545.1512924904@sss.pgh.pa.us>
<CA+TgmoYkeOcbg415LURWXmM-GdpRzvkM_sOjmL-C1-Cxz9RjWQ@mail.gmail.com>
<16763.1513014382@sss.pgh.pa.us>
<20970.1513025521@sss.pgh.pa.us>
<CA+TgmoZBd3F0jkw0mvtAKm2OgJR=HL-aqtr5pFVhrVjH2M=XMA@mail.gmail.com>
Robert Haas <robertmhaas@gmail.com> writes:
> On Mon, Dec 11, 2017 at 3:52 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Here's a quick hack at that. I guess the main question that needs to be
>> asked is whether we're happy with plpgsql getting so much chattier
>> (as per all the regression test changes).
> I confess to never having really grokked, even in the pre-patch state,
> why we sometimes get an "SQL statement" context line and sometimes
> not. However, what strikes me about this is that the SQL statement is
> a completely fabricated one that the user never entered.
I spent a brief amount of time looking at whether we could hide the
"fabricated statements" more thoroughly, and decided that it would
be a lot more work than seems warranted, and there would likely be
holes in it anyway. It's not like we don't document this behavior:
the plpgsql introductory material says
All expressions used in PL/pgSQL statements are processed using
the server's main SQL executor. For example, when you write a
PL/pgSQL statement like
IF expression THEN ...
PL/pgSQL will evaluate the expression by feeding a query like
SELECT expression
to the main SQL engine.
https://www.postgresql.org/docs/devel/static/plpgsql-expressions.html
So basically my conclusion at this point is that I'm not willing
to do any more work on this than the patch I already proposed.
If you want to do something more invasive, have at it.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com
Subject: Re: Inconsistency in plpgsql's error context reports
In-Reply-To: <7449.1513194640@sss.pgh.pa.us>
References: <31545.1512924904@sss.pgh.pa.us> <CA+TgmoYkeOcbg415LURWXmM-GdpRzvkM_sOjmL-C1-Cxz9RjWQ@mail.gmail.com> <16763.1513014382@sss.pgh.pa.us> <20970.1513025521@sss.pgh.pa.us> <CA+TgmoZBd3F0jkw0mvtAKm2OgJR=HL-aqtr5pFVhrVjH2M=XMA@mail.gmail.com> <7449.1513194640@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