pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Report the correct is_temporary flag for column defaults.
Date: Thu, 11 Sep 2025 21:12:26 +0000
Message-ID: <E1uwoag-000EsI-0Y@gemulon.postgresql.org> (raw)

Report the correct is_temporary flag for column defaults.

pg_event_trigger_dropped_objects() would report a column default
object with is_temporary = false, even if it belongs to a
temporary table.  This seems clearly wrong, so adjust it to
report the table's temp-ness.

While here, refactor EventTriggerSQLDropAddObject to make its
handling of namespace objects less messy and avoid duplication
of the schema-lookup code.  And add some explicit test coverage
of dropped-object reports for dependencies of temp tables.

Back-patch to v15.  The bug exists further back, but the
GetAttrDefaultColumnAddress function this patch depends on does not,
and it doesn't seem worth adjusting it to cope with the older code.

Author: Antoine Violin <violin.antuan@gmail.com>
Co-authored-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CAFjUV9x3-hv0gihf+CtUc-1it0hh7Skp9iYFhMS7FJjtAeAptA@mail.gmail.com
Backpatch-through: 15

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3c02c46521b01f1e60caff2d056f3da5ee98ce58

Modified Files
--------------
src/backend/commands/event_trigger.c        | 111 ++++++++++++++++++++--------
src/test/regress/expected/event_trigger.out |  37 ++++++++++
src/test/regress/sql/event_trigger.sql      |  20 +++++
3 files changed, 136 insertions(+), 32 deletions(-)



view thread (5+ messages)  latest in thread

Message-ID: <E1uwoag-000EsI-0Y@gemulon.postgresql.org>
Permalink:  ../E1uwoag-000EsI-0Y@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1uwoag-000EsI-0Y@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: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Report the correct is_temporary flag for column defaults.
  In-Reply-To: <E1uwoag-000EsI-0Y@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