Re: CURRENT OF causes an error when IndexOnlyScan is used

2018-03-16 Thread Tom Lane
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 do

Re: CURRENT OF causes an error when IndexOnlyScan is used

2018-03-16 Thread Tom Lane
Yugo Nagata writes: > On Mon, 12 Mar 2018 13:56:24 -0400 > Tom Lane wrote: >> I took a quick look at this, but I'm concerned about a couple of points: > In addition, this patch fixes only nbtree indexes, but the simillar problem > will occur also on GIST indexes which support index-only scan. If

Re: CURRENT OF causes an error when IndexOnlyScan is used

2018-03-15 Thread Yugo Nagata
On Mon, 12 Mar 2018 13:56:24 -0400 Tom Lane wrote: > Anastasia Lubennikova writes: > > [ return_heaptuple_in_btree_indexonlyscan_v2.patch ] > > I took a quick look at this, but I'm concerned about a couple of points: > > 1. What's the performance penalty of forming (and then deforming) the > a

Re: CURRENT OF causes an error when IndexOnlyScan is used

2018-03-12 Thread Tom Lane
Anastasia Lubennikova writes: > [ return_heaptuple_in_btree_indexonlyscan_v2.patch ] I took a quick look at this, but I'm concerned about a couple of points: 1. What's the performance penalty of forming (and then deforming) the added heap tuple? We'd be paying it for every index-only scan, whet

Re: CURRENT OF causes an error when IndexOnlyScan is used

2018-02-21 Thread Anastasia Lubennikova
20.02.2018 12:52, Aleksander Alekseev: Hi Anastasia, I'd like to propose the patch that fixes the issue. We already have a way to return heaptuple from IndexOnlyScan, but it was not applied to b-tree for some reason. Attached patch solves the reported bug. Moreover, it will come in handy for "

Re: CURRENT OF causes an error when IndexOnlyScan is used

2018-02-20 Thread Aleksander Alekseev
Hi Anastasia, > I'd like to propose the patch that fixes the issue. > We already have a way to return heaptuple from IndexOnlyScan, > but it was not applied to b-tree for some reason. > > Attached patch solves the reported bug. > Moreover, it will come in handy for "index with included attributes

Re: CURRENT OF causes an error when IndexOnlyScan is used

2018-02-19 Thread Anastasia Lubennikova
01.02.2018 05:12, Tom Lane: Yugo Nagata writes: I'm sorry the patch attached in the previous mail is broken and not raises a compile error. I attached the fixed patch. This patch is almost certainly wrong: you can't assume that the scan-level state matches the tuple we are currently processing

Re: CURRENT OF causes an error when IndexOnlyScan is used

2018-01-31 Thread Yugo Nagata
On Wed, 31 Jan 2018 21:12:51 -0500 Tom Lane wrote: > Yugo Nagata writes: > > I'm sorry the patch attached in the previous mail is broken and > > not raises a compile error. I attached the fixed patch. > > This patch is almost certainly wrong: you can't assume that the scan-level > state matches

Re: CURRENT OF causes an error when IndexOnlyScan is used

2018-01-31 Thread Tom Lane
Yugo Nagata writes: > I'm sorry the patch attached in the previous mail is broken and > not raises a compile error. I attached the fixed patch. This patch is almost certainly wrong: you can't assume that the scan-level state matches the tuple we are currently processing at top level. Any sort of

Re: CURRENT OF causes an error when IndexOnlyScan is used

2018-01-31 Thread Yugo Nagata
On Thu, 1 Feb 2018 01:33:49 +0900 Yugo Nagata wrote: I'm sorry the patch attached in the previous mail is broken and not raises a compile error. I attached the fixed patch. Regards, > Hi, > > I found that updating a cursor by using CURRENT OF causes the > following error when the query is exec

CURRENT OF causes an error when IndexOnlyScan is used

2018-01-31 Thread Yugo Nagata
Hi, I found that updating a cursor by using CURRENT OF causes the following error when the query is executed by IndexOnlyScan. ERROR: cannot extract system attribute from virtual tuple IndexOnlyScan returns a virtual tuple that doesn't have system column, so we can not get ctid in the same wa