pgsql: Change ALTER TABLE SET WITHOUT OIDS to rewrite the whole table to

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Change ALTER TABLE SET WITHOUT OIDS to rewrite the whole table to
Date: 2009-02-11 21:11:16
Message-ID: 20090211211116.9F6C97559ED@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
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.

Modified Files:
--------------
pgsql/doc/src/sgml/ref:
alter_table.sgml (r1.103 -> r1.104)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/ref/alter_table.sgml?r1=1.103&r2=1.104)
pgsql/src/backend/commands:
tablecmds.c (r1.279 -> r1.280)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/tablecmds.c?r1=1.279&r2=1.280)
pgsql/src/backend/parser:
gram.y (r2.657 -> r2.658)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/gram.y?r1=2.657&r2=2.658)
pgsql/src/include/nodes:
parsenodes.h (r1.390 -> r1.391)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/parsenodes.h?r1=1.390&r2=1.391)
pgsql/src/test/regress/expected:
alter_table.out (r1.114 -> r1.115)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/alter_table.out?r1=1.114&r2=1.115)
pgsql/src/test/regress/sql:
alter_table.sql (r1.60 -> r1.61)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/alter_table.sql?r1=1.60&r2=1.61)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2009-02-11 21:21:38 Re: Re: [COMMITTERS] pgsql: Update autovacuum to use reloptions instead of a system catalog,
Previous Message Alvaro Herrera 2009-02-11 20:48:17 Re: Re: [COMMITTERS] pgsql: Update autovacuum to use reloptions instead of a system catalog,