Re: Inconsistency in plpgsql's error context reports
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2017-12-11T17:40:55Z
Lists: pgsql-hackers
On Sun, Dec 10, 2017 at 11:55 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> There seem to be two ways we could look at this. One is that the
> new test case just needs to be rejiggered to avoid unstable output
> ("\set VERBOSITY terse" would be the easiest way). But there is
> also room to argue that it's bad that plpgsql produces error reports
> that vary depending on the phase of the moon, which is pretty much
> what this would look like in the field --- cache flushes will occur
> unpredictably in most application environments.
I am inclined toward the latter view. I think predictability is very
important and that lack of predictability is both frustrating for
users and a sign of poor programming practices under the hood. Nobody
likes clicking on the same thing twice and getting a different result
each time; as humans, we want to feel like we understand how things
work, and if they work differently at different times, we tend to
either question whether we understand them or question whether they
are actually robust systems. For example, lately my car has started
to take a variable number of gallons of gasoline to fill the tank from
almost-empty to completely full. I find that rather unnerving: how do
I know whether I'm going to run out of gas? Similarly here -- I'm not
sure whether people want that extra CONTEXT line or not, but I think
they're going to want to either get it or not get it consistently. If
not, they'll tend to feel like something is flaky.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Commits
-
Stabilize output of new regression test case.
- 9edc97b712e2 11.0 landed
-
Fix plpgsql to reinitialize record variables at block re-entry.
- 390d58135b22 11.0 cited