Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 28fb1c1

Browse files
committed
Update create_rule manual page.
1 parent dce53f0 commit 28fb1c1

File tree

9 files changed

+500
-134
lines changed

9 files changed

+500
-134
lines changed

doc/src/sgml/func.sgml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,14 @@
688688
<entry>SSSS</entry>
689689
<entry>seconds past midnight (0-86399)</entry>
690690
</row>
691+
<row>
692+
<entry>AM or A.M. or PM or P.M.</entry>
693+
<entry>meridian indicator (upper case)</entry>
694+
</row>
695+
<row>
696+
<entry>am or a.m. or pm or p.m.</entry>
697+
<entry>meridian indicator (lower case)</entry>
698+
</row>
691699
<row>
692700
<entry>Y,YYY</entry>
693701
<entry>year (4 and more digits) with comma</entry>
@@ -708,6 +716,14 @@
708716
<entry>Y</entry>
709717
<entry>last digit of year</entry>
710718
</row>
719+
<row>
720+
<entry>BC or B.C. or AD or A.D.</entry>
721+
<entry>year indicator (upper case)</entry>
722+
</row>
723+
<row>
724+
<entry>bc or b.c. or ad or a.d.</entry>
725+
<entry>year indicator (lower case)</entry>
726+
</row>
711727
<row>
712728
<entry>MONTH</entry>
713729
<entry>full upper case month name (9 chars)</entry>
@@ -794,7 +810,11 @@
794810
</row>
795811
<row>
796812
<entry>RM</entry>
797-
<entry>month in Roman Numerals (I-XII; I=JAN)</entry>
813+
<entry>month in Roman Numerals (I-XII; I=JAN) - upper case</entry>
814+
</row>
815+
<row>
816+
<entry>rn</entry>
817+
<entry>month in Roman Numerals (I-XII; I=JAN) - lower case</entry>
798818
</row>
799819
</tbody>
800820
</tgroup>

doc/src/sgml/ref/create_rule.sgml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_rule.sgml,v 1.13 2000/04/07 17:37:24 momjian Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_rule.sgml,v 1.14 2000/04/07 19:17:30 momjian Exp $
33
Postgres documentation
44
-->
55

@@ -126,16 +126,17 @@ CREATE
126126
<para>
127127
The <productname>Postgres</productname>
128128
<firstterm>rule system</firstterm> allows one to define an
129-
alternate action to be performed on updates, inserts, or deletions
129+
alternate action to be performed on inserts, updates, or deletions
130130
from database tables or classes. Currently, rules are used to
131131
implement table views.
132132
</para>
133133

134134
<para>
135135
The semantics of a rule is that at the time an individual instance is
136-
accessed, updated, inserted or deleted, there is a current instance (for
137-
retrieves, updates and deletes) and a new instance (for updates and
138-
appends). If the <replaceable class="parameter">event</replaceable>
136+
accessed, inserted, updated, or deleted, there is a current instance (for
137+
selects, updates and deletes) and a new instance (for inserts and
138+
updates).
139+
If the <replaceable class="parameter">event</replaceable>
139140
specified in the ON clause and the
140141
<replaceable class="parameter">condition</replaceable> specified in the
141142
WHERE clause are true for the current instance, the
@@ -162,8 +163,8 @@ CREATE
162163
<para>
163164
A caution about SQL rules is in order. If the same class name
164165
or instance variable appears in the
165-
<replaceable class="parameter">event</replaceable>, the
166-
<replaceable class="parameter">condition</replaceable> and the
166+
<replaceable class="parameter">event</replaceable>,
167+
<replaceable class="parameter">condition</replaceable> and
167168
<replaceable class="parameter">action</replaceable> parts of a rule,
168169
they are all considered different tuple variables. More accurately,
169170
<literal>new</literal> and <literal>current</literal> are the only tuple
@@ -172,13 +173,13 @@ CREATE
172173
<programlisting>
173174
ON UPDATE TO emp.salary WHERE emp.name = "Joe"
174175
DO
175-
UPDATE emp ( ... ) WHERE ...
176+
UPDATE emp SET ... WHERE ...
176177
</programlisting>
177178

178179
<programlisting>
179180
ON UPDATE TO emp-1.salary WHERE emp-2.name = "Joe"
180181
DO
181-
UPDATE emp-3 ( ... ) WHERE ...
182+
UPDATE emp-3 SET ... WHERE ...
182183
</programlisting>
183184

184185
Each rule can have the optional tag INSTEAD.
@@ -194,11 +195,12 @@ ON UPDATE TO emp-1.salary WHERE emp-2.name = "Joe"
194195
<literal>NOTHING</literal>.
195196
</para>
196197
<para>
197-
It is very important to note that the rewrite rule system
198-
will neither detect nor process circular rules. For example, though each
198+
It is very important to note to avoid circular rules.
199+
For example, though each
199200
of the following two rule definitions are accepted by
200201
<productname>Postgres</productname>, the
201-
retrieve command will cause <productname>Postgres</productname> to crash:
202+
select command will cause <productname>Postgres</productname> to
203+
report an error because the query cycled too many times:
202204

203205
<example>
204206
<title>Example of a circular rewrite rule combination.</title>
@@ -216,8 +218,9 @@ CREATE RULE bad_rule_combination_2 AS
216218
SELECT TO emp;
217219
</programlisting>
218220
<para>
219-
This attempt to retrieve from EMP will cause
220-
<productname>Postgres</productname> to crash.
221+
This attempt to select from EMP will cause
222+
<productname>Postgres</productname> to issue an error
223+
because the queries cycled too many times.
221224
<programlisting>
222225
SELECT * FROM emp;
223226
</programlisting></para>
@@ -306,7 +309,7 @@ CREATE toyemp(name = char16, salary = int4);
306309
CREATE RULE example_4 AS
307310
ON SELECT TO toyemp
308311
DO INSTEAD
309-
SELECT (emp.name, emp.salary)
312+
SELECT emp.name, emp.salary
310313
FROM emp
311314
WHERE emp.dept = "toy";
312315
</programlisting>
@@ -317,7 +320,7 @@ CREATE RULE example_4 AS
317320
CREATE RULE example_5 AS
318321
ON INERT TO emp WHERE new.salary > 5000
319322
DO
320-
UPDATE NEWSET salary = 5000;
323+
UPDATE NEWSET SET salary = 5000;
321324
</programlisting>
322325
</para>
323326
</refsect1>

0 commit comments

Comments
 (0)