pgsql: Fix ALTER TABLE ONLY .. DROP CONSTRAINT.

Поиск
Список
Период
Сортировка
От Robert Haas
Тема pgsql: Fix ALTER TABLE ONLY .. DROP CONSTRAINT.
Дата
Msg-id E1RD6q3-0003KD-5s@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix ALTER TABLE ONLY .. DROP CONSTRAINT.

When I consolidated two copies of the HOT-chain search logic in commit
4da99ea4231e3d8bbf28b666748c1028e7b7d665, I introduced a behavior
change: the old code wouldn't necessarily traverse the entire chain,
if the most recently returned tuple were updated while the HOT chain
traversal is in progress.  The new behavior seems more correct, but
unfortunately, the code here relies on a scan with SnapshotNow failing
to see its own updates.  That seems pretty shaky even with the old HOT
chain traversal behavior, since there's no guarantee that these
updates will always be HOT, but it's trivial to broke a failure with
the new HOT search logic.  Fix by updating just the first matching
pg_constraint tuple, rather than all of them, since there should be
only one anyway.  But since nobody has reproduced this failure on older
versions, no back-patch for now.

Report and test case by Alex Hunsaker; tablecmds.c changes by me.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/c0f03aae0469e758964faac0fb741685170c39a5

Modified Files
--------------
src/backend/commands/tablecmds.c          |   99 ++++++++++++++---------------
src/test/regress/expected/alter_table.out |    9 +++
src/test/regress/sql/alter_table.sql      |    8 +++
3 files changed, 65 insertions(+), 51 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: pgsql: Revert accidental change to pg_config_manual.h.
Следующее
От: Bruce Momjian
Дата:
Сообщение: pgsql: In pg_upgrade, add -o/-O options to pass parameters to the serve