Remove logic for converting a table to a view.
authorTom Lane <[email protected]>
Fri, 2 Dec 2022 17:14:32 +0000 (12:14 -0500)
committerTom Lane <[email protected]>
Fri, 2 Dec 2022 17:14:32 +0000 (12:14 -0500)
commitb23cd185fd5410e5204683933f848d4583e34b35
tree2b69ac2d2e0658ab42fbffe46e61dedee96b9b2b
parent66456da1505b8347a6d2ddd23b34e62e904c4908
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-ed 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  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
doc/src/sgml/rules.sgml
src/backend/rewrite/rewriteDefine.c
src/test/modules/test_ddl_deparse/expected/create_rule.out
src/test/modules/test_ddl_deparse/sql/create_rule.sql
src/test/regress/expected/rowsecurity.out
src/test/regress/expected/rules.out
src/test/regress/sql/rowsecurity.sql
src/test/regress/sql/rules.sql