Re: CURRENT OF causes an error when IndexOnlyScan is used
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Yugo Nagata <nagata@sraoss.co.jp>
Cc: Anastasia Lubennikova <a.lubennikova@postgrespro.ru>,
pgsql-hackers@lists.postgresql.org
Date: 2018-03-16T21:34:06Z
Lists: pgsql-hackers
Attachments
- handle-where-current-of-failure-better.patch (text/x-diff) patch
I wrote: > In the meantime, we could fix execCurrent.c so that it throws > FEATURE_NOT_SUPPORTED rather than the current failure if the slot it's > looking at doesn't contain a physical tuple. Concretely, I think we should do the attached, so as to cover any other situations where the scan type doesn't return a physical tuple. I kept it separate from your patch so it's easy to test (the original case you gave now throws the appropriate error). The existing error when execCurrentOf can't figure out what to do with the plan is ERRCODE_INVALID_CURSOR_STATE with message "cursor \"%s\" is not a simply updatable scan of table \"%s\"" so for this draft patch I just used that. I'm not sure if it would be a better idea to throw a different SQLSTATE or different error text for this case. Any thoughts on that? regards, tom lane
Commits
-
Fix WHERE CURRENT OF when the referenced cursor uses an index-only scan.
- 8f5ac440430a 11.0 landed
- ee7bf0fd9fa7 10.4 landed
- 7de7ddb27a86 9.5.13 landed
- 5b77c11da24a 9.3.23 landed
- 12d18b4870a2 9.6.9 landed
- 0a0721f84c40 9.4.18 landed