pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix another issue with ENABLE/DISABLE TRIGGER on partitioned tab
4+ messages / 1 participants
[nested] [flat]

* pgsql: Fix another issue with ENABLE/DISABLE TRIGGER on partitioned tab
@ 2023-04-05 16:56 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2023-04-05 16:56 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix another issue with ENABLE/DISABLE TRIGGER on partitioned tables.

In v13 and v14, the ENABLE/DISABLE TRIGGER USER variant malfunctioned
on cloned triggers, failing to find the clones because it thought they
were system triggers.  Other variants of ENABLE/DISABLE TRIGGER would
improperly apply a superuserness check.  Fix by adjusting the is-it-
a-system-trigger check to match reality in those branches.  (As far
as I can find, this is the only place that got it wrong.)

There's no such bug in v15/HEAD, because we revised the catalog
representation of system triggers to be what this code was expecting.
However, add the test case to these branches anyway, because this area
is visibly pretty fragile.  Also remove an obsoleted comment.

The recent v15/HEAD commit 6949b921d fixed a nearby bug.  I now see
that my commit message for that was inaccurate: the behavior of
recursing to clone triggers is older than v15, but it didn't apply
to the case in v13/v14 because in those branches parent partitioned
tables have no pg_trigger entries for foreign-key triggers.  But add
the test case from that commit to v13/v14, just to show what is
happening there.

Per bug #17886 from DzmitryH.

Discussion: https://postgr.es/m/17886-5406d5d828aa4aa3@postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4766eef3174b0b1bd8d2428381a7a33813386a6a

Modified Files
--------------
src/backend/commands/trigger.c         |  5 -----
src/test/regress/expected/triggers.out | 12 ++++++++++++
src/test/regress/sql/triggers.sql      |  5 +++++
3 files changed, 17 insertions(+), 5 deletions(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Fix another issue with ENABLE/DISABLE TRIGGER on partitioned tab
@ 2023-04-05 16:56 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2023-04-05 16:56 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix another issue with ENABLE/DISABLE TRIGGER on partitioned tables.

In v13 and v14, the ENABLE/DISABLE TRIGGER USER variant malfunctioned
on cloned triggers, failing to find the clones because it thought they
were system triggers.  Other variants of ENABLE/DISABLE TRIGGER would
improperly apply a superuserness check.  Fix by adjusting the is-it-
a-system-trigger check to match reality in those branches.  (As far
as I can find, this is the only place that got it wrong.)

There's no such bug in v15/HEAD, because we revised the catalog
representation of system triggers to be what this code was expecting.
However, add the test case to these branches anyway, because this area
is visibly pretty fragile.  Also remove an obsoleted comment.

The recent v15/HEAD commit 6949b921d fixed a nearby bug.  I now see
that my commit message for that was inaccurate: the behavior of
recursing to clone triggers is older than v15, but it didn't apply
to the case in v13/v14 because in those branches parent partitioned
tables have no pg_trigger entries for foreign-key triggers.  But add
the test case from that commit to v13/v14, just to show what is
happening there.

Per bug #17886 from DzmitryH.

Discussion: https://postgr.es/m/17886-5406d5d828aa4aa3@postgresql.org

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2624de79efe8d6866ddaf82ab780c96ad554b004

Modified Files
--------------
src/backend/commands/trigger.c         |  5 -----
src/test/regress/expected/triggers.out | 12 ++++++++++++
src/test/regress/sql/triggers.sql      |  5 +++++
3 files changed, 17 insertions(+), 5 deletions(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Fix another issue with ENABLE/DISABLE TRIGGER on partitioned tab
@ 2023-04-05 16:56 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2023-04-05 16:56 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix another issue with ENABLE/DISABLE TRIGGER on partitioned tables.

In v13 and v14, the ENABLE/DISABLE TRIGGER USER variant malfunctioned
on cloned triggers, failing to find the clones because it thought they
were system triggers.  Other variants of ENABLE/DISABLE TRIGGER would
improperly apply a superuserness check.  Fix by adjusting the is-it-
a-system-trigger check to match reality in those branches.  (As far
as I can find, this is the only place that got it wrong.)

There's no such bug in v15/HEAD, because we revised the catalog
representation of system triggers to be what this code was expecting.
However, add the test case to these branches anyway, because this area
is visibly pretty fragile.  Also remove an obsoleted comment.

The recent v15/HEAD commit 6949b921d fixed a nearby bug.  I now see
that my commit message for that was inaccurate: the behavior of
recursing to clone triggers is older than v15, but it didn't apply
to the case in v13/v14 because in those branches parent partitioned
tables have no pg_trigger entries for foreign-key triggers.  But add
the test case from that commit to v13/v14, just to show what is
happening there.

Per bug #17886 from DzmitryH.

Discussion: https://postgr.es/m/17886-5406d5d828aa4aa3@postgresql.org

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0a6aaf01166c5f8f94abba949b92b2003c7fe9b5

Modified Files
--------------
src/backend/commands/trigger.c         |  2 +-
src/test/regress/expected/triggers.out | 39 ++++++++++++++++++++++++++++++++++
src/test/regress/sql/triggers.sql      | 21 ++++++++++++++++++
3 files changed, 61 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* pgsql: Fix another issue with ENABLE/DISABLE TRIGGER on partitioned tab
@ 2023-04-05 16:56 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2023-04-05 16:56 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix another issue with ENABLE/DISABLE TRIGGER on partitioned tables.

In v13 and v14, the ENABLE/DISABLE TRIGGER USER variant malfunctioned
on cloned triggers, failing to find the clones because it thought they
were system triggers.  Other variants of ENABLE/DISABLE TRIGGER would
improperly apply a superuserness check.  Fix by adjusting the is-it-
a-system-trigger check to match reality in those branches.  (As far
as I can find, this is the only place that got it wrong.)

There's no such bug in v15/HEAD, because we revised the catalog
representation of system triggers to be what this code was expecting.
However, add the test case to these branches anyway, because this area
is visibly pretty fragile.  Also remove an obsoleted comment.

The recent v15/HEAD commit 6949b921d fixed a nearby bug.  I now see
that my commit message for that was inaccurate: the behavior of
recursing to clone triggers is older than v15, but it didn't apply
to the case in v13/v14 because in those branches parent partitioned
tables have no pg_trigger entries for foreign-key triggers.  But add
the test case from that commit to v13/v14, just to show what is
happening there.

Per bug #17886 from DzmitryH.

Discussion: https://postgr.es/m/17886-5406d5d828aa4aa3@postgresql.org

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/b02bf1e46048ff4b8e9138fb0d5c1fa442fd7380

Modified Files
--------------
src/backend/commands/trigger.c         |  2 +-
src/test/regress/expected/triggers.out | 39 ++++++++++++++++++++++++++++++++++
src/test/regress/sql/triggers.sql      | 21 ++++++++++++++++++
3 files changed, 61 insertions(+), 1 deletion(-)



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2023-04-05 16:56 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-04-05 16:56 pgsql: Fix another issue with ENABLE/DISABLE TRIGGER on partitioned tab Tom Lane <tgl@sss.pgh.pa.us>
2023-04-05 16:56 pgsql: Fix another issue with ENABLE/DISABLE TRIGGER on partitioned tab Tom Lane <tgl@sss.pgh.pa.us>
2023-04-05 16:56 pgsql: Fix another issue with ENABLE/DISABLE TRIGGER on partitioned tab Tom Lane <tgl@sss.pgh.pa.us>
2023-04-05 16:56 pgsql: Fix another issue with ENABLE/DISABLE TRIGGER on partitioned tab Tom Lane <tgl@sss.pgh.pa.us>

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