postgresql/src/include/commands
Alvaro Herrera 65225900de Fix ALTER EXTENSION / SET SCHEMA
In its original conception, it was leaving some objects into the old
schema, but without their proper pg_depend entries; this meant that the
old schema could be dropped, causing future pg_dump calls to fail on the
affected database.  This was originally reported by Jeff Frost as #6704;
there have been other complaints elsewhere that can probably be traced
to this bug.

To fix, be more consistent about altering a table's subsidiary objects
along the table itself; this requires some restructuring in how tables
are relocated when altering an extension -- hence the new
AlterTableNamespaceInternal routine which encapsulates it for both the
ALTER TABLE and the ALTER EXTENSION cases.

There was another bug lurking here, which was unmasked after fixing the
previous one: certain objects would be reached twice via the dependency
graph, and the second attempt to move them would cause the entire
operation to fail.  Per discussion, it seems the best fix for this is to
do more careful tracking of objects already moved: we now maintain a
list of moved objects, to avoid attempting to do it twice for the same
object.

Authors: Alvaro Herrera, Dimitri Fontaine
Reviewed by Tom Lane
2012-10-31 10:49:14 -03:00
..
alter.h Fix ALTER EXTENSION / SET SCHEMA 2012-10-31 10:49:14 -03:00
async.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
cluster.h Make ALTER TABLE revalidate uniqueness and exclusion constraints. 2011-01-20 22:44:10 -05:00
collationcmds.h pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
comment.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
conversioncmds.h Core support for "extensions", which are packages of SQL objects. 2011-02-08 16:13:22 -05:00
copy.h pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
dbcommands.h pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
defrem.h REASSIGN OWNED: Support foreign data wrappers and servers 2012-02-22 17:32:42 -03:00
discard.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
explain.h pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
extension.h Have REASSIGN OWNED work on extensions, too 2012-07-03 15:19:02 -04:00
lockcmds.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
portalcmds.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
prepare.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
proclang.h pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
schemacmds.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
seclabel.h pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
sequence.h Implement remaining fields of information_schema.sequences view 2011-01-02 15:15:21 +02:00
tablecmds.h Fix ALTER EXTENSION / SET SCHEMA 2012-10-31 10:49:14 -03:00
tablespace.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
trigger.h pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
typecmds.h Fix ALTER EXTENSION / SET SCHEMA 2012-10-31 10:49:14 -03:00
user.h Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
vacuum.h Fix VACUUM so that it always updates pg_class.reltuples/relpages. 2011-05-30 17:06:52 -04:00
variable.h Revise the API for GUC variable assign hooks. 2011-04-07 00:12:02 -04:00
view.h Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00