pgsql: Get rid of any toast table when converting a table to a view. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Get rid of any toast table when converting a table to a view.
Date
Msg-id E1UCIuk-0003ml-02@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Get rid of any toast table when converting a table to a view.

Also make sure other fields of the view's pg_class entry are appropriate
for a view; it shouldn't have relfrozenxid set for instance.

This ancient omission isn't believed to have any serious consequences in
versions 8.4-9.2, so no backpatch.  But let's fix it before it does bite
us in some serious way.  It's just luck that the case doesn't cause
problems for autovacuum.  (It did cause problems in 8.3, but that's out
of support.)

Andres Freund

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/b15a6da29217b14f02895af1d9271e84415a91ae

Modified Files
--------------
src/backend/rewrite/rewriteDefine.c  |   98 ++++++++++++++++++++++++++++++----
src/backend/rewrite/rewriteSupport.c |   11 +---
src/include/rewrite/rewriteSupport.h |    3 +-
src/test/regress/expected/rules.out  |    7 +++
src/test/regress/sql/rules.sql       |    3 +
5 files changed, 101 insertions(+), 21 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Fix SQL function execution to be safe with long-lived FmgrInfos.
Next
From: Kevin Grittner
Date:
Subject: pgsql: Add a materialized view relations.