1
1
.\" This is -*-nroff-*-
2
2
.\" XXX standard disclaimer belongs here....
3
- .\" $Header: /cvsroot/pgsql/src/man/Attic/create_rule.l,v 1.9 1998/06/24 13:21:24 momjian Exp $
3
+ .\" $Header: /cvsroot/pgsql/src/man/Attic/create_rule.l,v 1.10 1999/02/02 17:46:17 momjian Exp $
4
4
.TH "CREATE RULE" SQL 11/05/95 PostgreSQL PostgreSQL
5
5
.SH NAME
6
6
create rule - define a new rule
@@ -124,11 +124,11 @@ Postgres to
124
124
--
125
125
--Example of a circular rewrite rule combination.
126
126
--
127
- create rule bad_rule_combination_1 is
127
+ create rule bad_rule_combination_1 as
128
128
on select to EMP
129
129
do instead select to TOYEMP
130
130
131
- create rule bad_rule_combination_2 is
131
+ create rule bad_rule_combination_2 as
132
132
on select to TOYEMP
133
133
do instead select to EMP
134
134
@@ -146,7 +146,7 @@ access to a class in order to define a rule on it.
146
146
--
147
147
--Make Sam get the same salary adjustment as Joe
148
148
--
149
- create rule example_1 is
149
+ create rule example_1 as
150
150
on update EMP.salary where current.name = "Joe"
151
151
do update EMP (salary = new.salary)
152
152
where EMP.name = "Sam"
@@ -161,7 +161,7 @@ Joe's salary on to Sam.
161
161
--
162
162
--Make Bill get Joe's salary when it is accessed
163
163
--
164
- create rule example_2 is
164
+ create rule example_2 as
165
165
on select to EMP.salary
166
166
where current.name = "Bill"
167
167
do instead
@@ -172,7 +172,7 @@ create rule example_2 is
172
172
--Deny Joe access to the salary of employees in the shoe
173
173
--department. (pg_username() returns the name of the current user)
174
174
--
175
- create rule example_3 is
175
+ create rule example_3 as
176
176
on select to EMP.salary
177
177
where current.dept = "shoe"
178
178
and pg_username() = "Joe"
@@ -184,7 +184,7 @@ create rule example_3 is
184
184
--
185
185
create TOYEMP(name = name, salary = int4)
186
186
187
- create rule example_4 is
187
+ create rule example_4 as
188
188
on select to TOYEMP
189
189
do instead select (EMP.name, EMP.salary) from EMP
190
190
where EMP.dept = "toy"
@@ -193,7 +193,7 @@ create rule example_4 is
193
193
--
194
194
--All new employees must make 5,000 or less
195
195
--
196
- create rule example_5 is
196
+ create rule example_5 as
197
197
on insert to EMP where new.salary > 5000
198
198
do update newset salary = 5000
199
199
.fi
0 commit comments