pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix assertion failure with PL/Python exceptions
Date: Mon, 18 Sep 2023 23:32:06 +0000
Message-ID: <E1qiNio-004e9o-0N@gemulon.postgresql.org> (raw)

Fix assertion failure with PL/Python exceptions

PLy_elog() was not able to handle correctly cases where a SPI called
failed, which would fill in a DETAIL string able to trigger an
assertion.  We may want to improve this infrastructure so as it is able
to provide any extra detail information provided by an error stack, but
this is left as a future improvement as it could impact existing error
stacks and any applications that depend on them.  For now, the assertion
is removed and a regression test is added to cover the case of a failure
with a detail string.

This problem exists since 2bd78eb8d51c, so backpatch all the way down
with tweaks to the regression tests output added where required.

Author: Alexander Lakhin
Discussion: https://postgr.es/m/18070-ab9c171cbf4ebb0f@postgresql.org
Backpatch-through: 11

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/35e8ba3e54ec01fb705c31061eaeda56ba904354

Modified Files
--------------
src/pl/plpython/expected/plpython_error.out   | 13 +++++++++++++
src/pl/plpython/expected/plpython_error_5.out | 13 +++++++++++++
src/pl/plpython/plpy_elog.c                   |  3 ---
src/pl/plpython/sql/plpython_error.sql        | 11 +++++++++++
4 files changed, 37 insertions(+), 3 deletions(-)



view thread (7+ messages)  latest in thread

Message-ID: <E1qiNio-004e9o-0N@gemulon.postgresql.org>
Permalink:  ../E1qiNio-004e9o-0N@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1qiNio-004e9o-0N@gemulon.postgresql.org

 · 

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: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix assertion failure with PL/Python exceptions
  In-Reply-To: <E1qiNio-004e9o-0N@gemulon.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 DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox