From: Tom Lane <tgl@sss.pgh.pa.us>
To: wangsiyan2@huawei.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19085: Using EXECUTE to run a multi-statement SQL string causes an assertion failure
Date: Tue, 14 Oct 2025 01:34:05 -0400
Message-ID: <894012.1760420045@sss.pgh.pa.us> (raw)
In-Reply-To: <19085-3e215c0d39d3f674@postgresql.org>
References: <19085-3e215c0d39d3f674@postgresql.org>
PG Bug reporting form <noreply@postgresql.org> writes:
> The issue is triggered by a PL/pgSQL procedure that dynamically executes a
> multi-statement SQL string via EXECUTE, combining DECLARE CURSOR and FETCH
> (e.g., "DECLARE test_cursor_1_1 CURSOR FOR SELECT * FROM test_table_1; FETCH
> 200 FROM test_cursor_1_1"). This fails with
> Assert(ActiveSnapshot->as_snap->regd_count == 0) in snapmgr.c:754 because
> the snapshot's registration count (regd_count) reaches 2 during SPI's
> multi-statement processing loop.
I cannot reproduce this assertion, either in master or REL_18_STABLE
branch tip. Are you testing community Postgres, or some locally
modified version?
regards, tom lane
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: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, wangsiyan2@huawei.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19085: Using EXECUTE to run a multi-statement SQL string causes an assertion failure
In-Reply-To: <894012.1760420045@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox