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

pgsql: Tighten integrity checks on ALTER TABLE ...

From: rhaas(at)postgresql(dot)org (Robert Haas)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Tighten integrity checks on ALTER TABLE ...
Date: 2010-02-01 19:28:56
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-committers
Log Message:
Tighten integrity checks on ALTER TABLE ... ALTER COLUMN ... RENAME.

When a column is renamed, we recursively rename the same column in
all descendent tables.  But if one of those tables also inherits that
column from a table outside the inheritance hierarchy rooted at the
named table, we must throw an error.  The previous coding correctly
prohibited the rename when the parent had inherited the column from
elsewhere, but overlooked the case where the parent was OK but a child
table also inherited the same column from a second, unrelated parent.

For now, not backpatched due to lack of complaints from the field.

KaiGai Kohei, with further changes by me.
Reviewed by Bernd Helme and Tom Lane.

Modified Files:
        pg_inherits.c (r1.5 -> r1.6)
        alter.c (r1.33 -> r1.34)
        analyze.c (r1.148 -> r1.149)
        tablecmds.c (r1.320 -> r1.321)
        prepunion.c (r1.179 -> r1.180)
        pg_inherits_fn.h (r1.2 -> r1.3)
        tablecmds.h (r1.45 -> r1.46)
        inherit.out (r1.31 -> r1.32)
        inherit.sql (r1.15 -> r1.16)

pgsql-committers by date

Next:From: User GleuDate: 2010-02-01 20:38:33
Subject: pgsnap - pgsnap: Add collation and ctype info in the databases report.
Previous:From: Robert HaasDate: 2010-02-01 17:28:28
Subject: Re: [COMMITTERS] pgsql: Augment EXPLAIN output with more details on Hash nodes.

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