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 1vUmTM-007UR4-13 for pgsql-hackers@arkaria.postgresql.org; Sun, 14 Dec 2025 13:49:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vUmTL-00D72S-0j for pgsql-hackers@arkaria.postgresql.org; Sun, 14 Dec 2025 13:49:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vUmTK-00D72A-2e for pgsql-hackers@lists.postgresql.org; Sun, 14 Dec 2025 13:49:15 +0000 Received: from mail-ot1-x32b.google.com ([2607:f8b0:4864:20::32b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vUmTK-000cxY-0J for pgsql-hackers@lists.postgresql.org; Sun, 14 Dec 2025 13:49:14 +0000 Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-7c52fa75cd3so2432299a34.3 for ; Sun, 14 Dec 2025 05:49:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765720152; x=1766324952; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=hDEHv6e4x9VxhOwrSJ8/fyQdMTuBYpJ+Kg9R7LlGj4s=; b=hWhfXVY4+1dwzr+CqkoxpJlGH3usJKSBMtdPrcfGhGyARCF5D1aeXbnSadFs7HooGH l6zvjftDeqw1cGA6deNbAKNUGj/lGZ6g96QmI9nmjR4RwftBmIUIJkEH31mT1BgGYqTJ XAWs7y+bOZsyTpQpojjwA7x/P5eEAw/qw4P0U9yumS4UuGt91PCi2lwJG6XLGeEHWf55 BUUc/JXnI6d0GvI7CnZqMHonHoQ81Y985FGnKUrZulqsnltvTa9mNHWdNEWYGH2PK0Fa lr7EhgOi/2pAfgKPgB4245casdYzL/6HH6zn2VzgZU1ohFSOA9W7bs+5p9oUparhngvd /MPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765720152; x=1766324952; h=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=hDEHv6e4x9VxhOwrSJ8/fyQdMTuBYpJ+Kg9R7LlGj4s=; b=cPPgt/n7/eepfTsnCab5d/8xUaQygSH+6wlu1xEPm1OuCxNz14qKJuJ+h0Se6HYx90 Z6V4v9ol4DkPVCtzLwQ/e7AysbDdzfKQt5cZY/Xk6GdTnw4D9R5RBD+pDounTsfNx3FJ Ziy4Wm2lrAyP0aQSY+buyrGe9BJ8fyQIZE4fCTX0w8MnyV2pbfVa0WEQUiQJWuORRuft e0q8W0VQ/DtCnvwBdMvD5FMuKZt2Vy+8R2h3KLzznCUJFYXTuDRXdWyFNxMGTd8gJ9sF +6fF0+cEg8cL5PH9XGXFpnw+vZmApt2XnYNkiosjdDTiji3ZQeCQtG8AyafUMHkDvJhE huQA== X-Forwarded-Encrypted: i=1; AJvYcCUdjnY8Ud/XVMoB2Oo9/fecE0W1H0obaBnP1NFJ7jWQ/Wba1IL687AnzrE+ouTBDQk/J2SvtOoSEhUNxPrW@lists.postgresql.org X-Gm-Message-State: AOJu0Yynp0bmmj+Q0th6U7TItJ3Asotuk4NV5xSpDRboHefHHm8KN8m+ jbLnA+I2Io6hLpAJJ0R8iXfGWwb750AUDCgMb0FbBZ+PsMsWQEPZIq7oFdIIzgEs/fimXqPfK5b gPOcP4G5z0g5e1z3EpvjjdEaUiGV05eQ= X-Gm-Gg: AY/fxX5yQA7eZg/f4Mqfra3fLiu/F/HJe1PqzyjqXbXncQPMuyJKAcyOlkJWtIr0Mxs BlETIXYseJpAk6yPKViwdR/AvyY4MI1rvwR5kcsmt+9GXozNQbNdXU6PatQg3Ui/uwDs8YwBpPq icz1Vv6A5934gSy3at/3oPwiNG9vcAiOnTpiRXpPlhvCygKGp0rpvTFyRN6LbXI1MQqXhxlv4nv ViRzRKNxNgc127YnlF7Sqs7mhq4WwFyiZVGCFvV2MLLVqj6DEq0hN0ijN21EzavVsdnJA== X-Google-Smtp-Source: AGHT+IFR5f+pbC8R5uDA4WblpGlkq5UU0YGaJatGhEqVlzEV5dX6JqVH7EOcd+A6uLeWNNEF969JIOJCOpBr9PLjk/I= X-Received: by 2002:a05:6820:210a:b0:659:9a49:8ff3 with SMTP id 006d021491bc7-65b451b7f15mr3238399eaf.32.1765720152434; Sun, 14 Dec 2025 05:49:12 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Dave Cramer Date: Sun, 14 Dec 2025 08:48:57 -0500 X-Gm-Features: AQt7F2oq3vqTPRANV7k5rAXuUhcPiy9_MZakY9xVLhuODCeXESb4IcCzFO3zx8o Message-ID: Subject: Re: Proposal to allow setting cursor options on Portals To: Jelte Fennema-Nio Cc: Jacob Champion , PostgreSQL Hackers , Heikki Linnakangas Content-Type: multipart/alternative; boundary="000000000000756cf60645e9c21f" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000756cf60645e9c21f Content-Type: text/plain; charset="UTF-8" On Sun, 14 Dec 2025 at 08:42, Jelte Fennema-Nio wrote: > On Sun, 14 Dec 2025 at 13:31, Dave Cramer wrote: > >> Exactly. Don't you want to make sure that clients in the ecosystem are > >> able to use this _before_ we rev the version again, and again? We > >> don't ever get these numbers back. > > > > Well there are 97 of them. 1 per year is a long time. > > I don't think Jacob was concerned about the actual numbers running > out, but in case he was: it's actually 9997 versions that we still > have (9996 after we'd commit the grease proposal[1]). > > [1]: https://commitfest.postgresql.org/patch/6157/ > > > FWIW, HOLDABLE cursors are not the only option this enables. It enables > all of the other cursor options. > > As mentioned upthread, I'm not sure BINARY makes sense. For any other > options, the protocol docs should specify which ones are allowed and > what their bits are. Looking at the DECLARE docs[2]. > Here I was thinking that binary was the one that did make sense. The pgjdbc driver would like the results back in binary, I believe others would as well. > 1. I think supporting ASENSITVE/INSENSITIVE/SENSITIVE bits is > unnecessary, since postgres cursors are always INSENSITIVE. > 2. For SCROLL vs NO SCROLL, it would be nice if we could get rid of > the intermediate mode where if neither SCROLL or NO SCROLL is > specified, it's still SCROLL sometimes. I'm not sure backwards > compatibility would allow that, i.e. can you currently sometimes do a > BACKWARD scan on a portal created with Bind. I guess we could make it > so that if you specify the portal flags, then you have to be explicit > abuot specifying SCROLL or NO SCROLL > 3. All the flags with no SQL variant probably shouldn't be > configurable through the protocol too (e.g. CURSOR_OPT_FAST_PLAN) > > [2]: https://www.postgresql.org/docs/18/sql-declare.html > > > Are we concerned with servers that are not compatible with Postgres ? > > I think there's enough re-implementations of the postgres protocol by > other databases that it would be a shame if we didn't even try to > consider them, but I wouldn't consider it critical to get it right. > Since they can always throw application errors for features they don't > support, just like they do now for SQL that they don't support. They > can always contribute changes to clients to make using unsupported > features opt-in in the rare case where they are not. > Fair, but from my POV, we are only concerned with Postgres. I would say it's up to the other implementations to deal with incompatibilities. Dave --000000000000756cf60645e9c21f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On S= un, 14 Dec 2025 at 08:42, Jelte Fennema-Nio <postgres@jeltef.nl> wrote:
On Sun, 14 Dec 2025 at 13:31, Dave Cramer <= davecramer@gmail.= com> wrote:
>> Exactly. Don't you want to make sure that clients in the ecosy= stem are
>> able to use this _before_ we rev the version again, and again? We<= br> >> don't ever get these numbers back.
>
> Well there are 97 of them. 1 per year is a long time.

I don't think Jacob was concerned about the actual numbers running
out, but in case he was: it's actually 9997 versions that we still
have (9996 after we'd commit the grease proposal[1]).

[1]: https://commitfest.postgresql.org/patch/6157/<= br>
> FWIW, HOLDABLE cursors are not the only option this enables. It enable= s all of the other cursor options.

As mentioned upthread, I'm not sure BINARY makes sense. For any other options, the protocol docs should specify which ones are allowed and
what their bits are. Looking at the DECLARE docs[2].
<= br>
Here I was thinking that binary was the one that did make sen= se. The pgjdbc driver would like the results back in binary, I believe othe= rs would as well.

=C2=A0
1. I think supporting ASENSITVE/INSENSITIVE/SENSITIVE bits is
unnecessary, since postgres cursors are always INSENSITIVE.
2. For SCROLL vs NO SCROLL, it would be nice if we could get rid of
the intermediate mode where if neither SCROLL or NO SCROLL is
specified, it's still SCROLL sometimes. I'm not sure backwards
compatibility would allow that, i.e. can you currently sometimes do a
BACKWARD scan on a portal created with Bind. I guess we could make it
so that if you specify the portal flags, then you have to be explicit
abuot specifying SCROLL or NO SCROLL
3. All the flags with no SQL variant probably shouldn't be
configurable through the protocol too (e.g. CURSOR_OPT_FAST_PLAN)

[2]: https://www.postgresql.org/docs/18/sql-decla= re.html

> Are we concerned with servers that are not compatible with Postgres ?<= br>
I think there's enough re-implementations of the postgres protocol by other databases that it would be a shame if we didn't even try to
consider them, but I wouldn't consider it critical to get it right.
Since they can always throw application errors for features they don't<= br> support, just like they do now for SQL that they don't support. They can always contribute changes to clients to make using unsupported
features opt-in in the rare case where they are not.
<= br>
Fair, but from my POV, we are only concerned with Postgres. I= would say it's up to the other implementations to deal with incompatib= ilities.

Dave=C2=A0
--000000000000756cf60645e9c21f--