Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wEjUn-004LIq-1F for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Apr 2026 07:56:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wEjUm-001Mpm-1i for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Apr 2026 07:56:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wEjUm-001Mpe-0i for pgsql-hackers@lists.postgresql.org; Mon, 20 Apr 2026 07:56:40 +0000 Received: from mail-qt1-x82c.google.com ([2607:f8b0:4864:20::82c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wEjUk-0000000268i-0Ggp for pgsql-hackers@lists.postgresql.org; Mon, 20 Apr 2026 07:56:39 +0000 Received: by mail-qt1-x82c.google.com with SMTP id d75a77b69052e-506362ac5f7so23547831cf.1 for ; Mon, 20 Apr 2026 00:56:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776671796; cv=none; d=google.com; s=arc-20240605; b=WdwZTWBamrCU362adDvAhmd9dakTieQs/76UrteDGrFi/Al62H2SESEvM6/DpPKv2o 148WJDJW/WgN4Ks3JgVzuUXmvXW1r/4gG0/wrsZX5kDq6iGvFy3zOkjUnRIBUggc82wQ ForJ/yxjX0BV2GZwSHz220ICrh10c1ud4ngxvx9G+DIeQRgKyBWu+OJH4WS3aHN5D6T4 QlgOtzW4HSy4/ACVkIEYopb+TUwjb+2npE2mdtbOmSNoJwTrBAa6doZYrKth0jk9u2+t wC7CATTEjxbYzNJkEe1vrMDQeG5HvH85SUailxt/A0QVBMl+0uAv0QempDPR72gc+giW 4zug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=cnAcvHqPgLg6SesHOZBffIA+FDklHwHNRZSxa2aZFIs=; fh=PDhzRmLFhJQgKl2kpY6iqaoiggk+rKjB8rXL7ERgOws=; b=MIcBnpc+Jrdbfmg8Rg0Pxxx1Lt46Iu7fTzuvqUr428ptdKel2bjokUMJwDEHOthpQL OZzuciE10A6VHaDRTEKzfZHZ/Ipcz4LHOA7lKJ7s+eCDZU1sG2u2xOkSRpWDp8nPxd7r EFlR8ihPIYauMbAgTAutmibEMMfL+eZlQC6NZQlpb5MOCRPLjoc19QOpviL70O64S5+i wtlY1CAEkL22qGMuYSYQzg7P0G2WXGbVetPb65a6Osxn06cy/G0CXreD090z+Wm4Fwh+ IaiD2wjtwkPh85yQDB7UH2UW7zvX4hfyMoYcqY1QjJIoy6AVr/Xv0cvK7tKACFyT3UP9 zshQ==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776671796; x=1777276596; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=cnAcvHqPgLg6SesHOZBffIA+FDklHwHNRZSxa2aZFIs=; b=XE88qoqSat/3zwXNA6jT2g2DlFQDZ6s5nAUunQPU4BFsV7ofJ7jh/76omLX/Cj97SH 8FGPpFUpUpY+lWhgHx/Z8oU4RfxlSbfhinS+prtT6f3sEM+ysdjQeq6hRmx6cD1uDYuK 6SZig7+H2q7kI9/xJbEKiNMZEj8A7KjFBnXq5eG0IWdrcmbLJRclmdmeJn5eQU4/bBCi FzEvW1lTGZBWYgAP8yVxLRsa9BQ3EMVw2uk7dO30ODXxSqI6lFGoxB63b5vVmpKRPeMq 3aqRHdO6u8a7D/4yGxsPuWEbzzr1pnzv1X9V2qxPrNib/m8XhFhgakFFCX5DWG35yhfm Pcxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776671796; x=1777276596; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=cnAcvHqPgLg6SesHOZBffIA+FDklHwHNRZSxa2aZFIs=; b=g7IbnXFShxPZp9K5OxpB33KljMXSHcPzaLg21J8Vhk1uv36LeaTTL4We9artNeFrHF tgoIcFyYNA3vuP3whXBRoh4OK6iQAD08O656uk6nu8DQeKmRlrn6sui3bYA53ozYBatx 1B6JHdfFZ4hdETt7Vxw4xpWdhL24lZY06ccdcLsQu0P1K0F/34T0JaLtVp206gHvlH5K MygKOgn5mEolcbKWhA+6HF+Z9CzMhh5Bcx7wKb7QnCnKQWQAO3JP+pg/JJ+z4k8gJe+5 fsFyHVxsUmGTFpgxK830ow9IlxxLo8U58qHcIgiFcOd400tyJQGGxWH1+D5dBF15G/mE GQUg== X-Gm-Message-State: AOJu0YzZQSiPV9mkESdnrOIy9FN3rEo43t0+QzMbuxztZ93bJKUzFG5W TJhqvtZGRzeMoSpwsqH1hCrc1kLqElXBgVmdBfEjOjLntFT1EpP8qJPCRKqGSb6D8rK8xnz2eYn XtFA4aDMHArInmFWlrDJ7iCED0okYJKo= X-Gm-Gg: AeBDiesJTaFCFO03FSzZOhScx99k7uiKtNAGkJ62KRrXFnMudZkheqE4kw0FtKMXO81 kbppzt4pwOQNGrLfBi/tuVj26Ed2el0iOsvXOCJuMdBYTbv9+sLJ4/xuvdkN74vc72X35ixyP2Q aSRkNgKAobfUo++l8rOmXEYlF/vWVCb3RJiMyHaWXNZK87R9C+6GGl8hqcMl6jG2ZUkGxaHmRSp ywOypr3iYRkuq5U+0FOUvUGwRvWkWftYtXnQMm8yoCqNJB52ip6moWJw2npBgMGS9dv06V8LisV WuP1PnIm0ky7XrHCS3LZm/Wfc9a8TljmYPYfbDwVMacNq67OxhnL X-Received: by 2002:a05:622a:4d3:b0:50d:8050:a358 with SMTP id d75a77b69052e-50e36c8d688mr192716391cf.47.1776671795601; Mon, 20 Apr 2026 00:56:35 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dean Rasheed Date: Mon, 20 Apr 2026 08:56:23 +0100 X-Gm-Features: AQROBzCCjGo-O7updiZKfZY1eR3ygnazjYCTrsx_hNkGHxfzBEgwc6F5QZZHK0E Message-ID: Subject: Re: [BUG]: WHERE CURRENT OF cursor fail on tables that have virtual generated columns To: SATYANARAYANA NARLAPURAM Cc: PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 20 Apr 2026 at 01:33, SATYANARAYANA NARLAPURAM wrote: > > On Sun, Apr 19, 2026 at 3:42=E2=80=AFAM Dean Rasheed 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 dif= ferently 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. Regards, Dean