Change ALTER TABLE SET WITHOUT OIDS to rewrite the whole table to physically
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 11 Feb 2009 21:11:16 +0000 (21:11 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 11 Feb 2009 21:11:16 +0000 (21:11 +0000)
commitab77dec0d1f9567892b6d818739f64a9492ed853
tree1b648e63c28980c02c9a4425e2aa30d22a547b8f
parent786b344fcd668c0d325409fada48a8f7d7d07882
Change ALTER TABLE SET WITHOUT OIDS to rewrite the whole table to physically
get rid of the OID column.  This eliminates the problem discovered by Heikki
back in November that 8.4's suppression of "unnecessary" junk filtering in
INSERT/SELECT could lead to an Assert failure, or storing of oids into a table
that shouldn't have them if Asserts are off.  While that particular problem
could have been solved in other ways, it seems likely to be just a forerunner
of things to come if we continue to allow tables to contain rows that disagree
with the pg_class.relhasoids setting.  It's better to make this operation slow
than to sacrifice performance or risk bugs in more common code paths.

Also, add ALTER TABLE SET WITH OIDS to rewrite the table to add oids.
This was a bit more controversial, but in view of the very small amount of
extra code needed given the current ALTER TABLE infrastructure, it seems best
to eliminate the asymmetry in features.
doc/src/sgml/ref/alter_table.sgml
src/backend/commands/tablecmds.c
src/backend/parser/gram.y
src/include/nodes/parsenodes.h
src/test/regress/expected/alter_table.out
src/test/regress/sql/alter_table.sql