public inbox for [email protected]  
help / color / mirror / Atom feed
From: SATYANARAYANA NARLAPURAM <[email protected]>
To: Dean Rasheed <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: [BUG]: WHERE CURRENT OF cursor fail on tables that have virtual generated columns
Date: Mon, 20 Apr 2026 01:03:18 -0700
Message-ID: <CAHg+QDdEVUvAB96FjCWgLoOhUWLqe+p4x2JaXyyhb=iBUFMhtw@mail.gmail.com> (raw)
In-Reply-To: <CAEZATCUr0hTb0v_Tz1b-j7=tU=TWHT=EqY9ms9qjFOukVFzKPg@mail.gmail.com>
References: <CAHg+QDc_TwzSgb=B_QgNLt3mvZdmRK23rLb+RkanSQkDF40GjA@mail.gmail.com>
	<CAEZATCUyKUrL_4pDZ=pqL68BcWznoyuCqGS3-7sm-Lc_UxS9HQ@mail.gmail.com>
	<CAHg+QDe3e-KOseG0SfumkX=Suu06YFZhchnv4c-7V_uWzDdmHA@mail.gmail.com>
	<CAEZATCUr0hTb0v_Tz1b-j7=tU=TWHT=EqY9ms9qjFOukVFzKPg@mail.gmail.com>

Hi

On Mon, Apr 20, 2026 at 12:56 AM Dean Rasheed <[email protected]>
wrote:

> On Mon, 20 Apr 2026 at 01:33, SATYANARAYANA NARLAPURAM
> <[email protected]> wrote:
> >
> > On Sun, Apr 19, 2026 at 3:42 AM Dean Rasheed <[email protected]>
> wrote:
> >>
> >> Hmm, it seems to me that a much simpler fix is to check for use of
> >> WHERE CURRENT OF on a view at parse time, and throw the error there.
> >
> > This patch looks simple and neat, is there any reason why it was done
> differently earlier?
> >
>
> I'm not sure, but possibly because it used to be possible to turn a
> table into a view by defining a SELECT rule on it, which could have
> rendered a parse-time check insufficient. That's no longer the case
> though, and we now have similar parse-time relkind tests elsewhere
> (e.g., for MERGE).
>
> > Updated the patch to include a test case to reject view update with
> WHERE CURRENT OF.
> >
>
> That's already tested in portals.sql, which seems like a better place
> for that test, since it's not related to virtual generated columns. I
> don't think another test is necessary -- admittedly portals.sql only
> tests DELETE, but the UPDATE code is the same, so I think the existing
> test is sufficient. We don't obsessively try to achieve 100% coverage
> in our tests.
>

Sounds good. Thanks for letting me know.


view thread (6+ messages)  latest in thread

reply

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: [BUG]: WHERE CURRENT OF cursor fail on tables that have virtual generated columns
  In-Reply-To: <CAHg+QDdEVUvAB96FjCWgLoOhUWLqe+p4x2JaXyyhb=iBUFMhtw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox