[COMMITTERS] pgsql: Remove heuristic same-transaction test fromcheck_safe_enum_use( - Mailing list pgsql-committers

From Tom Lane
Subject [COMMITTERS] pgsql: Remove heuristic same-transaction test fromcheck_safe_enum_use(
Date
Msg-id E1dwtRp-0005Y9-Q1@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Remove heuristic same-transaction test from check_safe_enum_use().

The blacklist mechanism added by the preceding commit directly fixes
most of the practical cases that the same-transaction test was meant
to cover.  What remains is use-cases like
begin;create type e as enum('x');alter type e add value 'y';-- use 'y' somehowcommit;

However, because the same-transaction test is heuristic, it fails on
small variants of that, such as renaming the type or changing its
owner.  Rather than try to explain the behavior to users, let's
remove it and just have a rule that the newly added value can't be
used before being committed, full stop.  Perhaps later it will be
worth the implementation effort and overhead to have a more accurate
test for type-was-created-in-this-transaction.  We'll wait for some
field experience with v10 before deciding to do that.

Back-patch to v10.

Discussion: https://postgr.es/m/20170922185904.1448.16585@wrigleys.postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/984c92074d84a81dc17e9865fc79e264eb50ad61

Modified Files
--------------
doc/src/sgml/ref/alter_type.sgml   |  3 +--
src/backend/utils/adt/enum.c       | 41 +++++++++-----------------------------
src/test/regress/expected/enum.out | 18 ++++++++---------
src/test/regress/sql/enum.sql      | 11 +++++-----
4 files changed, 24 insertions(+), 49 deletions(-)


--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: [COMMITTERS] pgsql: Sort pg_basebackup options better
Next
From: Tom Lane
Date:
Subject: [COMMITTERS] pgsql: Fix failure-to-read-man-page in commit 899bd785c.