public inbox for [email protected]
help / color / mirror / Atom feedFrom: Haritabh Gupta <[email protected]>
To: [email protected]
Cc: Pavel Stehule <[email protected]>
Subject: Re: proposal: schema variables
Date: Wed, 04 Mar 2026 10:02:11 +0000
Message-ID: <177261853144.1094601.11795093672679754617.pgcf@coridan.postgresql.org> (raw)
In-Reply-To: <CAFj8pRDLL-srue=m+je26vFrMzwETWwOfsEVNwr7=_KhuWA1bQ@mail.gmail.com>
References: <CAFj8pRDY+m9OOxfO10R7J0PAkCCauM-TweaTrdsrsLGMb1VbEQ@mail.gmail.com>
<CAFj8pRDLL-srue=m+je26vFrMzwETWwOfsEVNwr7=_KhuWA1bQ@mail.gmail.com>
Hi,
While reviewing I came across this behaviour and wanted to
check whether it's intended:
CREATE TEMP VARIABLE y AS int;
LET y = 42;
BEGIN;
SAVEPOINT s1;
LET y = generate_series(1,2); -- ERROR: too many rows
ROLLBACK TO s1;
SELECT VARIABLE(y); -- returns 1, not 42
It looks like svariableReceiveSlot writes the first row to the
variable (pfree'ing the old datum) before the second row triggers the
error, so the old value is lost even though LET failed.
I understand variable values are intentionally non-transactional, but
is it expected that a failed LET has this side effect?
---
Haritabh Gupta
Supabase
view thread (439+ 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: proposal: schema variables
In-Reply-To: <177261853144.1094601.11795093672679754617.pgcf@coridan.postgresql.org>
* 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