1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Change naming rule for ON SELECT rules of views: they're all just

_RETURN now, since there's no need to keep 'em unique anymore.
This commit is contained in:
Tom Lane
2002-04-19 23:13:54 +00:00
parent 201737168c
commit 6d6ca2166c
13 changed files with 50 additions and 97 deletions

View File

@ -1,5 +1,5 @@
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_rule.sgml,v 1.34 2002/04/19 16:36:08 tgl Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_rule.sgml,v 1.35 2002/04/19 23:13:53 tgl Exp $
PostgreSQL documentation
-->
@ -268,12 +268,12 @@ CREATE
report an error because the query cycled too many times:
<programlisting>
CREATE RULE "_RETemp" AS
CREATE RULE "_RETURN" AS
ON SELECT TO emp
DO INSTEAD
SELECT * FROM toyemp;
CREATE RULE "_RETtoyemp" AS
CREATE RULE "_RETURN" AS
ON SELECT TO toyemp
DO INSTEAD
SELECT * FROM emp;

View File

@ -1,4 +1,4 @@
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/rules.sgml,v 1.22 2002/03/22 19:20:26 petere Exp $ -->
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/rules.sgml,v 1.23 2002/04/19 23:13:53 tgl Exp $ -->
<Chapter Id="rules">
<Title>The Rule System</Title>
@ -289,7 +289,7 @@ CREATE VIEW myview AS SELECT * FROM mytab;
<ProgramListing>
CREATE TABLE myview (<Replaceable>same attribute list as for mytab</Replaceable>);
CREATE RULE "_RETmyview" AS ON SELECT TO myview DO INSTEAD
CREATE RULE "_RETURN" AS ON SELECT TO myview DO INSTEAD
SELECT * FROM mytab;
</ProgramListing>
@ -517,7 +517,7 @@ SELECT shoelace.sl_name, shoelace.sl_avail,
range table and checks if there are rules in <Filename>pg_rewrite</Filename>
for any relation. When processing the range table entry for
<Filename>shoelace</Filename> (the only one up to now) it finds the
rule <literal>_RETshoelace</literal> with the parse tree
<literal>_RETURN</literal> rule with the parse tree
<ProgramListing>
<emphasis>SELECT s.sl_name, s.sl_avail,
@ -1494,7 +1494,7 @@ UPDATE shoelace_data SET
Again it's an INSTEAD rule and the previous parse tree is trashed.
Note that this query still uses the view <Filename>shoelace</Filename>.
But the rule system isn't finished with this loop so it continues
and applies the rule <literal>_RETshoelace</literal> on it and we get
and applies the <literal>_RETURN</literal> rule on it and we get
<ProgramListing>
UPDATE shoelace_data SET