Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8e958b8

Browse files
committed
Fix create_rule is->as.
1 parent7ab88a1 commit8e958b8

File tree

6 files changed

+36
-44
lines changed

6 files changed

+36
-44
lines changed

‎doc/src/sgml/ports.sgml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ At the time of publication, the following platforms have been tested:
235235
<ENTRY>x86</ENTRY>
236236
<ENTRY>v6.4</ENTRY>
237237
<ENTRY>1998-10-08</ENTRY>
238-
<ENTRY>Mostly workingwith the Cygwin library. No DLLs yet.
238+
<ENTRY>Workingwith the Cygwin library.
239239
(<ulink url="mailto:Dan.Horak@email.cz">Horak Daniel</ulink>) </ENTRY>
240240
</ROW>
241241
</TBODY>
@@ -251,11 +251,7 @@ confirmation of such at the time this list was compiled.
251251
<para>
252252
For <productname>Windows NT</productname>,
253253
the server-side port of <productname>Postgres</productname> has recently been
254-
accomplished. Check
255-
<ulink url="http://www.askesis.nl/AskesisPostgresIndex.html">the Askesis Postgres Home Page</ulink>
256-
for up to date information. You may also want to
257-
look for possible patches on the
258-
<ulink url="http://postgresql.org">Postgres web site</ulink>.
254+
accomplished. The Cygnus library is required to compile it.
259255
</para>
260256
</note>
261257
</sect1>

‎doc/src/sgml/ref/create_rule.sgml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,11 @@ Without
198198
<example>
199199
<title>Example of a circular rewrite rule combination.</title>
200200
<programlisting>
201-
create rule bad_rule_combination_1is
201+
create rule bad_rule_combination_1as
202202
on select to EMP
203203
do instead select to TOYEMP
204204

205-
create rule bad_rule_combination_2is
205+
create rule bad_rule_combination_2as
206206
on select to TOYEMP
207207
do instead select to EMP
208208
</programlisting>
@@ -232,7 +232,7 @@ select * from EMP
232232
Make Sam get the same salary adjustment as Joe:
233233

234234
<programlisting>
235-
create rule example_1is
235+
create rule example_1as
236236
on update EMP.salary where current.name = "Joe"
237237
do update EMP (salary = new.salary)
238238
where EMP.name = "Sam"
@@ -248,7 +248,7 @@ create rule example_1 is
248248
<para>
249249
Make Bill get Joe's salary when it is accessed:
250250
<programlisting>
251-
create rule example_2is
251+
create rule example_2as
252252
on select to EMP.salary
253253
where current.name = "Bill"
254254
do instead
@@ -261,7 +261,7 @@ create rule example_2 is
261261
department (<function>current_user</function> returns the name of
262262
the current user):
263263
<programlisting>
264-
create rule example_3is
264+
create rule example_3as
265265
on select to EMP.salary
266266
where current.dept = "shoe" and current_user = "Joe"
267267
do instead nothing
@@ -272,7 +272,7 @@ create rule example_3 is
272272
<programlisting>
273273
create TOYEMP(name = char16, salary = int4)
274274

275-
create rule example_4is
275+
create rule example_4as
276276
on select to TOYEMP
277277
do instead
278278
select (EMP.name, EMP.salary) from EMP
@@ -282,7 +282,7 @@ create rule example_4 is
282282
<para>
283283
All new employees must make 5,000 or less
284284
<programlisting>
285-
create rule example_5is
285+
create rule example_5as
286286
on insert to EMP where new.salary > 5000
287287
do update newset salary = 5000
288288
</programlisting>

‎src/backend/optimizer/plan/planner.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.38 1999/01/25 18:02:15 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planner.c,v 1.39 1999/02/02 17:46:14 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -235,11 +235,10 @@ union_planner(Query *parse)
235235

236236
/***S*H***/
237237
/* Use 'new_tlist' instead of 'tlist' */
238-
result_plan=
239-
make_groupPlan(&new_tlist,
240-
tuplePerGroup,
241-
parse->groupClause,
242-
result_plan);
238+
result_plan=make_groupPlan(&new_tlist,
239+
tuplePerGroup,
240+
parse->groupClause,
241+
result_plan);
243242
}
244243

245244
/*
@@ -255,13 +254,12 @@ union_planner(Query *parse)
255254
result_plan= (Plan*)make_agg(tlist,result_plan);
256255

257256
/*
258-
*set the varno/attno entries to the appropriate references to
257+
*get the varno/attno entries to the appropriate references to
259258
* the result tuple of the subplans.
260259
*/
261260
((Agg*)result_plan)->aggs=
262261
get_agg_tlist_references((Agg*)result_plan);
263262

264-
265263
/***S*H***/
266264
if(parse->havingQual!=NULL)
267265
{
@@ -299,11 +297,13 @@ union_planner(Query *parse)
299297
((Agg*)result_plan)->plan.qual=(List*)parse->havingQual;
300298

301299
/* Check every clause of the havingQual for aggregates used and append
302-
* them to result_plan->aggs */
300+
* them to result_plan->aggs
301+
*/
303302
foreach(clause, ((Agg*)result_plan)->plan.qual)
304303
{
305304
/* Make sure there are aggregates in the havingQual
306-
* if so, the list must be longer after check_having_qual_for_aggs */
305+
* if so, the list must be longer after check_having_qual_for_aggs
306+
*/
307307
old_length=length(((Agg*)result_plan)->aggs);
308308

309309
((Agg*)result_plan)->aggs=nconc(((Agg*)result_plan)->aggs,

‎src/backend/optimizer/plan/setrefs.c

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.34 1999/01/26 05:57:14 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/optimizer/plan/setrefs.c,v 1.35 1999/02/02 17:46:15 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -701,7 +701,7 @@ OperandIsInner(Node *opnd, int inner_relid)
701701
/*---------------------------------------------------------
702702
*
703703
* get_agg_tlist_references -
704-
*changes the target list of an Agg node so that it points to
704+
*generates the target list of an Agg node so that it points to
705705
* the tuples returned by its left tree subplan.
706706
*
707707
*We now also generate a linked list of Aggref pointers for Agg.
@@ -1177,8 +1177,7 @@ check_having_qual_for_aggs(Node *clause, List *subplanTargetList, List *groupCla
11771177
foreach(t, ((List*) ((SubLink*) ((SubPlan*)
11781178
((Expr*)clause)->oper)->sublink)->lefthand))
11791179
{
1180-
agg_list=
1181-
nconc(agg_list,
1180+
agg_list=nconc(agg_list,
11821181
check_having_qual_for_aggs(lfirst(t),
11831182
subplanTargetList,groupClause));
11841183
}
@@ -1190,9 +1189,8 @@ check_having_qual_for_aggs(Node *clause, List *subplanTargetList, List *groupCla
11901189
foreach(tmp_ptr, ((SubLink*) ((SubPlan*)
11911190
((Expr*)clause)->oper)->sublink)->oper)
11921191
{
1193-
agg_list=
1194-
nconc(agg_list,
1195-
check_having_qual_for_aggs((Node*)lfirst(((Expr*)
1192+
agg_list=nconc(agg_list,
1193+
check_having_qual_for_aggs((Node*)lfirst(((Expr*)
11961194
lfirst(tmp_ptr))->args),
11971195
subplanTargetList,groupClause));
11981196
}
@@ -1220,9 +1218,8 @@ check_having_qual_for_aggs(Node *clause, List *subplanTargetList, List *groupCla
12201218
*/
12211219
if (contained_in_group_clause)
12221220
{
1223-
agg_list=
1224-
nconc(agg_list,
1225-
check_having_qual_for_aggs(lfirst(t),
1221+
agg_list=nconc(agg_list,
1222+
check_having_qual_for_aggs(lfirst(t),
12261223
subplanTargetList,groupClause));
12271224
}
12281225
else
@@ -1235,7 +1232,6 @@ check_having_qual_for_aggs(Node *clause, List *subplanTargetList, List *groupCla
12351232
}
12361233
else
12371234
{
1238-
12391235
/*
12401236
* Ooops! we can not handle that!
12411237
*/

‎src/include/optimizer/planmain.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: planmain.h,v 1.18 1999/01/25 18:02:28 momjian Exp $
9+
* $Id: planmain.h,v 1.19 1999/02/02 17:46:16 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -51,7 +51,7 @@ extern void add_missing_vars_to_tlist(Query *root, List *tlist);
5151
*/
5252
externvoidset_tlist_references(Plan*plan);
5353
externList*join_references(List*clauses,List*outer_tlist,
54-
List*inner_tlist);
54+
List*inner_tlist);
5555
externList*index_outerjoin_references(List*inner_indxqual,
5656
List*outer_tlist,Indexinner_relid);
5757
externList*get_agg_tlist_references(Agg*aggNode);

‎src/man/create_rule.l

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.\" This is -*-nroff-*-
22
.\" 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 $
44
.TH "CREATE RULE" SQL 11/05/95 PostgreSQL PostgreSQL
55
.SH NAME
66
create rule - define a new rule
@@ -124,11 +124,11 @@ Postgres to
124124
--
125125
--Example of a circular rewrite rule combination.
126126
--
127-
create rule bad_rule_combination_1is
127+
create rule bad_rule_combination_1as
128128
on select to EMP
129129
do instead select to TOYEMP
130130

131-
create rule bad_rule_combination_2is
131+
create rule bad_rule_combination_2as
132132
on select to TOYEMP
133133
do instead select to EMP
134134

@@ -146,7 +146,7 @@ access to a class in order to define a rule on it.
146146
--
147147
--Make Sam get the same salary adjustment as Joe
148148
--
149-
create rule example_1is
149+
create rule example_1as
150150
on update EMP.salary where current.name = "Joe"
151151
do update EMP (salary = new.salary)
152152
where EMP.name = "Sam"
@@ -161,7 +161,7 @@ Joe's salary on to Sam.
161161
--
162162
--Make Bill get Joe's salary when it is accessed
163163
--
164-
create rule example_2is
164+
create rule example_2as
165165
on select to EMP.salary
166166
where current.name = "Bill"
167167
do instead
@@ -172,7 +172,7 @@ create rule example_2 is
172172
--Deny Joe access to the salary of employees in the shoe
173173
--department. (pg_username() returns the name of the current user)
174174
--
175-
create rule example_3is
175+
create rule example_3as
176176
on select to EMP.salary
177177
where current.dept = "shoe"
178178
and pg_username() = "Joe"
@@ -184,7 +184,7 @@ create rule example_3 is
184184
--
185185
create TOYEMP(name = name, salary = int4)
186186

187-
create rule example_4is
187+
create rule example_4as
188188
on select to TOYEMP
189189
do instead select (EMP.name, EMP.salary) from EMP
190190
where EMP.dept = "toy"
@@ -193,7 +193,7 @@ create rule example_4 is
193193
--
194194
--All new employees must make 5,000 or less
195195
--
196-
create rule example_5is
196+
create rule example_5as
197197
on insert to EMP where new.salary > 5000
198198
do update newset salary = 5000
199199
.fi

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp