pgsql: Fix toast table creation.

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix toast table creation.
Date: 2011-04-14 01:18:17
Message-ID: E1QABCL-00062l-Cg@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix toast table creation.

Instead of using slightly-too-clever heuristics to decide when we must
create a TOAST table, just check whether one is needed every time the
table is altered. Checking whether a toast table is needed is cheap
enough that we needn't worry about doing it on every ALTER TABLE command,
and the previous coding is apparently prone to accidental breakage:
commit 04e17bae50a73af524731fa11210d5c3f7d8e1f9 broken ALTER TABLE ..
SET STORAGE, which moved some actions from AT_PASS_COL_ATTRS to
AT_PASS_MISC, and commit 6c5723998594dffa5d47c3cf8c96ccf89c033aae broke
ALTER TABLE .. ADD COLUMN by changing the way that adding columns
recurses into child tables.

Noah Misch, with one comment change by me

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/39a68e5c6ca7b41b889e773ca58535324af69630

Modified Files
--------------
src/backend/catalog/toasting.c | 10 +++++-----
src/backend/commands/tablecmds.c | 10 ++--------
src/test/regress/expected/alter_table.out | 13 +++++++++++++
src/test/regress/input/misc.source | 6 ++++++
src/test/regress/output/misc.source | 11 +++++++++++
src/test/regress/sql/alter_table.sql | 10 ++++++++++
6 files changed, 47 insertions(+), 13 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2011-04-14 02:22:10 pgsql: Remove obsolete comment.
Previous Message Tom Lane 2011-04-13 22:57:29 pgsql: Ensure mark_dummy_rel doesn't create dangling pointers in RelOpt