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.94.2) (envelope-from ) id 1uwNAe-000taJ-Dy for pgsql-general@arkaria.postgresql.org; Wed, 10 Sep 2025 15:55:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uwNAc-0026qu-6g for pgsql-general@arkaria.postgresql.org; Wed, 10 Sep 2025 15:55:42 +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.94.2) (envelope-from ) id 1uwNAb-0026ql-SQ for pgsql-general@lists.postgresql.org; Wed, 10 Sep 2025 15:55:42 +0000 Received: from mail-oo1-xc33.google.com ([2607:f8b0:4864:20::c33]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uwNAa-001gnR-1y for pgsql-general@postgresql.org; Wed, 10 Sep 2025 15:55:41 +0000 Received: by mail-oo1-xc33.google.com with SMTP id 006d021491bc7-62182f350ddso2514277eaf.3 for ; Wed, 10 Sep 2025 08:55:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757519739; x=1758124539; darn=postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=kGa9iP6KdzP26IF2W1XZpwioeH+5OzpkZZqVf3IJFx0=; b=Lhcu538yP4k81ztjTKIDKr2ro7Gs7WK9E9E0Pqw45Z/pvoBcBHk7nmDKLa0yzYxTdp gOHq3CkqYwpi5d/aIBN9vZT4WP3YvNmeUx8QIN37Wx0g1FylmB9xTUdqw/AFPqdl0PYi ofPN4CIyfBDAxLTuDqEiKNt5mPFrLSacCsVkwtMZY6at/mNFF3ZLytAl1cYcRll6rWxE 2FxAE8c8krALevtatRaFNzArC2wNZv8TPocIWtPaPxQk41QsSw+BzOUCCII/HyA9/MP0 2ebm7oBdluTg93qLZjVUmXrxaROJlbC9Prm9q/quixuWdEk2XevXZCXcv9awy57px8uj nWYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757519739; x=1758124539; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kGa9iP6KdzP26IF2W1XZpwioeH+5OzpkZZqVf3IJFx0=; b=Rll7ec1ADpU2K2tzLyrl8/WEyb/73/zeUr21qeDUEgCvIEIPk3i0hlKaMBkU7c8RvT QHgUPpewJPiFT4eph1H10EcBQLNAgQ1KmhVteD8RVOd+w7CnWtrjpYhSAoYmNjzS//cS q0gITB4MsIGBCPFGbkmu8iCqytTDlj75plK9lf/4QDbvwlg+klN/3cESRdL2b91pSQeD uV1sbQugxw2KyvXL0YyD9dLPcKinCU9em+3CppRfnpHRWNsc72M3xaKSI2V5jDwvS1qb EsYQujXpiCzZCaKCOB0Omgx4vD9tJ9NUtVXNdXgb0237p0/wjpuorwMzYjt67lczdnki nR4A== X-Gm-Message-State: AOJu0Yya/UWJpXqwrTde1vgmOKQhfIaXFGbKMQJF/IUHUPtpQ9DJTgE+ ILpQ9syJhf6znmAB8NtY6T+fA6Bj6eXAKyyr0H0JymMHpZE/0xVg4sF1f3m/qZ2yl6ZFGEUse2j rx+lsLEcXh7CX6I4c68fkad8PiU1T8DFFkobO X-Gm-Gg: ASbGncs+CoTG6cMOlosC41nU21OlhimITGoc8L66hd02pLV3PUVg/BNwch4Xx4+4cmX MTfeUlIgAR0ISbz1b7EQyiAmrh/L1pNMHxfJyJQVXx5NDAwKM4J/qUl6KQqJIXjxNtuPcOxDMVA vrDyU4+Vyau1urlp+aBSvHEmuOmKOscQ/DkrlLxrwYPYityUWjcMkEhvST51KZHe7bFqGk516GW BKGp5yrONNzPQ4OVTs= X-Google-Smtp-Source: AGHT+IGfkZ2garmKSzFAO9RGMEilJrX9WQvrYpXtjM3EocMAYC0ie+sseCa/J68MfpzEN05DlbK5lN9PZ8m+PFP305M= X-Received: by 2002:a05:6870:5691:b0:319:c3d3:21df with SMTP id 586e51a60fabf-322652399e5mr8757513fac.43.1757519739548; Wed, 10 Sep 2025 08:55:39 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ron Johnson Date: Wed, 10 Sep 2025 11:55:28 -0400 X-Gm-Features: Ac12FXxchdWGxiJtoBAONdoH-Gr2EtnpuaIKIRu6owwCIVfF5LF0l_y2EXAuHpw Message-ID: Subject: Re: MVCC and all that... To: pgsql-general Content-Type: multipart/alternative; boundary="000000000000c2f89e063e7473fa" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000c2f89e063e7473fa Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Sep 9, 2025 at 8:41=E2=80=AFPM Justin wrote: [snip] > Multiple transactions per connection. I am asking WHY is that a feature. > when one can have multiple sessions, what is the difference? running > multiple transactions in single or multiple sessions means moving part o= f > transaction logic into the application space. What do we gain here..... > If I interpret "Multiple transactions per connection" correctly, they're a great way to emulate WITH HOLD cursors. For example: 1. In channel #1, open a Read Only cursor. (Yes, this was long ago.) 2. Fetch a row. 3. Switch to channel #2, begin R/W txn, modify the table, commit. 4. Switch back to channel #1 5. Go to step 2. Not being an application developer anymore, I've never needed to use WITH HOLD cursors or wish for multiple channels in PG. --=20 Death to , and butter sauce. Don't boil me, I'm still alive. lobster! --000000000000c2f89e063e7473fa Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Sep 9, 2025 at 8:41=E2=80=AFPM Ju= stin <zzzzz.graf@gmail.com&g= t; wrote:
[snip]= =C2=A0
Multiple transactions per connection.=C2=A0 I am asking WHY is tha= t a feature.=C2=A0 when one can have multiple sessions, what=C2=A0is the di= fference?=C2=A0 running multiple transactions in single=C2=A0or multiple se= ssions means moving=C2=A0 part of transaction logic into the application sp= ace. What do we gain here.....
=C2=A0
If I interpret=C2=A0"Multiple transactions per connection" corr= ectly, they're a great way to emulate WITH HOLD cursors.

=
For example:
1. In channel #1, open a Read Only cursor= .=C2=A0 (Yes, this was long ago.)
2. Fetch a row.
3. Sw= itch to channel #2, begin R/W txn, modify the table, commit.
4. S= witch back to channel #1
5. Go to step 2.

Not being an application=C2=A0developer anymore, I've never needed to= use WITH HOLD cursors or wish for multiple channels in PG.

<= /div>
--
Death to <Redacted>,= and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!
--000000000000c2f89e063e7473fa--