Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pqyIs-0007aK-Hy for pgsql-general@arkaria.postgresql.org; Mon, 24 Apr 2023 15:40:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pqyIq-0001hP-Ot for pgsql-general@arkaria.postgresql.org; Mon, 24 Apr 2023 15:40:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pqyIq-0001hF-D4 for pgsql-general@lists.postgresql.org; Mon, 24 Apr 2023 15:40:32 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pqyIn-001eR1-Sm for pgsql-general@lists.postgresql.org; Mon, 24 Apr 2023 15:40:31 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 33OFeS1D201145; Mon, 24 Apr 2023 11:40:28 -0400 From: Tom Lane To: Garfield Lewis cc: "pgsql-general@lists.postgresql.org" Subject: Re: [EXT] Re: SCROLLABLE/UPDATABLE cursor question In-reply-to: References: <3705358.1682190174@sss.pgh.pa.us> Comments: In-reply-to Garfield Lewis message dated "Mon, 24 Apr 2023 15:25:30 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <201143.1682350828.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 24 Apr 2023 11:40:28 -0400 Message-ID: <201144.1682350828@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Garfield Lewis writes: > DECLARE cur0 SCROLL CURSOR FOR SELECT * FROM t0 FOR UPDATE; > psql:curs.pgs:4: ERROR: DECLARE SCROLL CURSOR ... FOR UPDATE is not sup= ported > DETAIL: Scrollable cursors must be READ ONLY. Ah. Yeah, I don't think anyone is contemplating changing that. Scrollable cursors with side effects would have unpleasant semantic issues about when do the side-effects happen, and can they happen multiple times (or, perhaps, not at all if you never read all of the query output)? FOR UPDATE would be slightly less messy than other kinds of side-effects, since it's idempotent; but only slightly. regards, tom lane