From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: pgsql-bugs@lists.postgresql.org
Cc: dejan.petrovic@islonline.com
Subject: Re: BUG #15060: Row in table not found when using pg function in an expression
Date: Mon, 12 Feb 2018 16:10:43 -0500
Message-ID: <14538.1518469843@sss.pgh.pa.us> (raw)
In-Reply-To: <12102.1518466287@sss.pgh.pa.us>
References: <151844034484.1446.1721073839109092583@wrigleys.postgresql.org>
<876072rphi.fsf@news-spur.riddles.org.uk>
<12102.1518466287@sss.pgh.pa.us>
I wrote:
> The attached patch makes it better and doesn't seem to break any
> regression tests. I'm not sure how nervous I am about unexpected
> side-effects ...
Oh ... my nervousness was justified. This is no good at all; it'd
create the same problem introduced at the client query level by
commit d573e239f and later reverted by 532994299, namely that we'd
be reading tables using a snapshot acquired before we've acquired
locks on said tables.
To really fix this complaint, it seems like we'd need to take a snapshot
before planning and then a new one after planning, matching what happens
in the main query pipeline. That's pretty nasty for performance :-(
... it would more or less double the load on the ProcArray for SPI-heavy
applications.
One could argue that, since this function is throwing an error, it's
not really stable --- that implies a lack of interesting side-effects.
I don't find that argument totally convincing, but the price of avoiding
the error might be more than we really want to pay.
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-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, andrew@tao11.riddles.org.uk, dejan.petrovic@islonline.com
Subject: Re: BUG #15060: Row in table not found when using pg function in an expression
In-Reply-To: <14538.1518469843@sss.pgh.pa.us>
References: <151844034484.1446.1721073839109092583@wrigleys.postgresql.org> <876072rphi.fsf@news-spur.riddles.org.uk> <12102.1518466287@sss.pgh.pa.us> <14538.1518469843@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