Re: BUG #15060: Row in table not found when using pg function in an expression

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
Cc: Marko Tiikkaja <marko(at)joh(dot)to>, pgsql-bugs(at)lists(dot)postgresql(dot)org, dejan(dot)petrovic(at)islonline(dot)com
Subject: Re: BUG #15060: Row in table not found when using pg function in an expression
Date: 2018-02-13 17:32:16
Message-ID: 24837.1518543136@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I wrote:
> Hm. So we could improve on the fix I proposed earlier if there were a
> way to tell GetCachedPlan "take a new snapshot even though there is an
> active snapshot". It's still expensive, but at least the code path where
> we use an existing generic plan doesn't get any added cost.

Here's a draft patch along those lines. Because it changes
GetCachedPlan's API, I'd be a bit worried about back-patching it; there
might be third-party code calling that directly. However, given that it
took so many years for anyone to notice a problem here, I think maybe
just fixing it in HEAD is fine.

regards, tom lane

Attachment Content-Type Size
use-new-snapshot-for-planning-in-non-readonly-SPI.patch text/x-diff 19.3 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2018-02-13 18:58:00 Re: 答复: response time is very long in PG9.5.5 using psql or jdbc
Previous Message Tom Lane 2018-02-13 14:53:59 Re: BUG #15060: Row in table not found when using pg function in an expression