Skip site navigation (1) Skip section navigation (2)

pgsql: Fix handling of inherited check constraints in ALTER COLUMNTYPE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix handling of inherited check constraints in ALTER COLUMNTYPE
Date: 2012-11-05 18:37:05
Message-ID: E1TVRXl-0006rx-Ro@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Fix handling of inherited check constraints in ALTER COLUMN TYPE.

This case got broken in 8.4 by the addition of an error check that
complains if ALTER TABLE ONLY is used on a table that has children.
We do use ONLY for this situation, but it's okay because the necessary
recursion occurs at a higher level.  So we need to have a separate
flag to suppress recursion without making the error check.

Reported and patched by Pavan Deolasee, with some editorial adjustments by
me.  Back-patch to 8.4, since this is a regression of functionality that
worked in earlier branches.

Branch
------
REL9_1_STABLE

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

Modified Files
--------------
src/backend/commands/tablecmds.c          |   44 +++++++++++++++++++++++-----
src/include/nodes/parsenodes.h            |    4 ++-
src/test/regress/expected/alter_table.out |   22 ++++++++++++++
src/test/regress/sql/alter_table.sql      |    7 ++++
4 files changed, 68 insertions(+), 9 deletions(-)

pgsql-committers by date

Next:From: Bruce MomjianDate: 2012-11-06 19:29:01
Subject: pgsql: In pg_upgrade, set synchronous_commit=off for the new cluster,t
Previous:From: User FxjrDate: 2012-11-04 23:09:37
Subject: npgsql - Npgsql2: Fixed test data insertion and function creation

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group