From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove logic for converting a table to a view.
Date: Fri, 02 Dec 2022 17:14:38 +0000
Message-ID: <E1p19cT-001j2q-QK@gemulon.postgresql.org> (raw)
Remove logic for converting a table to a view.
Up to now we have allowed manual creation of an ON SELECT rule on
a table to convert it into a view. That was never anything but a
horrid, error-prone hack though. pg_dump used to rely on that
behavior to deal with cases involving circular dependencies,
where a dependency loop could be broken by separating the creation
of a view from installation of its ON SELECT rule. However, we
changed pg_dump to use CREATE OR REPLACE VIEW for that in commit
d8c05aff5 (which was later back-patched as far as 9.4), so there's
not a good argument anymore for continuing to support the behavior.
The proximate reason for axing it now is that we found that the
new statistics code has failure modes associated with the relkind
change caused by this behavior. We'll patch around that in v15,
but going forward it seems like a better idea to get rid of the
need to support relkind changes.
Discussion: https://postgr.es/m/CALDaNm2yXz+zOtv7y5zBd5WKT8O0Ld3YxikuU3dcyCvxF7gypA@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/b23cd185fd5410e5204683933f848d4583e34b35
Modified Files
--------------
doc/src/sgml/rules.sgml | 28 +--
src/backend/rewrite/rewriteDefine.c | 189 ++-------------------
.../test_ddl_deparse/expected/create_rule.out | 8 +-
.../modules/test_ddl_deparse/sql/create_rule.sql | 8 +-
src/test/regress/expected/rowsecurity.out | 22 ---
src/test/regress/expected/rules.out | 46 +----
src/test/regress/sql/rowsecurity.sql | 24 ---
src/test/regress/sql/rules.sql | 25 +--
8 files changed, 45 insertions(+), 305 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Remove logic for converting a table to a view.
In-Reply-To: <E1p19cT-001j2q-QK@gemulon.postgresql.org>
References: <E1p19cT-001j2q-QK@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox