Skip to content

Commit 766fb7f

Browse files
committed
Mop-up for removal of ':' and ';' operators ... like, say, actually
take 'em out of pg_operator. Also remove from scan.l's set of legal operator characters. Update documentation.
1 parent 134fdf3 commit 766fb7f

File tree

5 files changed

+21
-72
lines changed

5 files changed

+21
-72
lines changed

doc/src/sgml/oper.sgml

Lines changed: 8 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/oper.sgml,v 1.16 2000/05/02 20:01:52 thomas Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/oper.sgml,v 1.17 2000/08/12 05:15:24 tgl Exp $
33
-->
44

55
<Chapter Id="operators">
@@ -83,20 +83,10 @@ Operator Ordering (decreasing precedence)
8383
<tbody>
8484
<row>
8585
<entry>
86-
UNION
87-
</entry>
88-
<entry>
89-
left
90-
</entry>
91-
<entry>
92-
SQL select construct
93-
</entry>
94-
</row>
95-
<row>
96-
<entry>
9786
::
9887
</entry>
9988
<entry>
89+
left
10090
</entry>
10191
<entry>
10292
<productname>Postgres</productname> typecasting
@@ -135,40 +125,26 @@ right
135125
unary minus
136126
</entry>
137127
</row>
138-
<!--
139-
Deprecated as of v7.0
140128
<row>
141129
<entry>
142-
;
130+
|
143131
</entry>
144132
<entry>
145133
left
146134
</entry>
147135
<entry>
148-
statement termination, logarithm
149-
</entry>
150-
</row>
151-
-->
152-
<row>
153-
<entry>
154-
:
155-
</entry>
156-
<entry>
157-
right
158-
</entry>
159-
<entry>
160-
exponentiation
136+
start of interval
161137
</entry>
162138
</row>
163139
<row>
164140
<entry>
165-
|
141+
^
166142
</entry>
167143
<entry>
168144
left
169145
</entry>
170146
<entry>
171-
start of interval
147+
power, exclusive or
172148
</entry>
173149
</row>
174150
<row>
@@ -228,6 +204,7 @@ test for NOT NULL
228204
(all other operators)
229205
</entry>
230206
<entry>
207+
left
231208
</entry>
232209
<entry>
233210
native and user-defined
@@ -265,7 +242,7 @@ time interval overlap
265242
</row>
266243
<row>
267244
<entry>
268-
LIKE
245+
LIKE ILIKE
269246
</entry>
270247
<entry>
271248
</entry>
@@ -486,19 +463,6 @@ logical union
486463
<ENTRY>Division</ENTRY>
487464
<ENTRY>4 / 2</ENTRY>
488465
</ROW>
489-
<ROW>
490-
<ENTRY> : </ENTRY>
491-
<ENTRY>Natural Exponentiation</ENTRY>
492-
<ENTRY>: 3.0</ENTRY>
493-
</ROW>
494-
<!--
495-
Deprecated in v7.0, esp. since ln() is available as a generic function.
496-
<ROW>
497-
<ENTRY> ; </ENTRY>
498-
<ENTRY>Natural Logarithm</ENTRY>
499-
<ENTRY>(; 5.0)</ENTRY>
500-
</ROW>
501-
-->
502466
<ROW>
503467
<ENTRY> @ </ENTRY>
504468
<ENTRY>Absolute value</ENTRY>
@@ -523,17 +487,6 @@ Deprecated in v7.0, esp. since ln() is available as a generic function.
523487
</TGROUP>
524488
</TABLE>
525489
</Para>
526-
527-
<para>
528-
<note>
529-
<para>
530-
Two operators, ":" and ";", are now deprecated and will be removed in
531-
the next release. Use the equivalent functions exp() and ln()
532-
instead.
533-
</para>
534-
</note>
535-
</para>
536-
537490
</sect1>
538491

539492
<sect1>

doc/src/sgml/ref/create_operator.sgml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_operator.sgml,v 1.14 2000/07/21 17:58:49 momjian Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_operator.sgml,v 1.15 2000/08/12 05:15:23 tgl Exp $
33
Postgres documentation
44
-->
55

@@ -177,15 +177,15 @@ CREATE
177177
is a sequence of up to NAMEDATALEN-1 (31 by default) characters
178178
from the following list:
179179
<literallayout>
180-
+ - * / &lt; &gt; = ~ ! @ # % ^ &amp; | ` ? $ :
180+
+ - * / &lt; &gt; = ~ ! @ # % ^ &amp; | ` ? $
181181
</literallayout>
182182

183183
There are a few restrictions on your choice of name:
184184
<itemizedlist>
185185
<listitem>
186186
<para>
187-
"$" and ":" cannot be defined as single-character operators,
188-
although they can be part of a multi-character operator name.
187+
"$" cannot be defined as a single-character operator,
188+
although it can be part of a multi-character operator name.
189189
</para>
190190
</listitem>
191191
<listitem>
@@ -199,7 +199,7 @@ CREATE
199199
A multi-character operator name cannot end in "+" or "-",
200200
unless the name also contains at least one of these characters:
201201
<literallayout>
202-
~ ! @ # % ^ &amp; | ` ? $ :
202+
~ ! @ # % ^ &amp; | ` ? $
203203
</literallayout>
204204
For example, <literal>@-</literal> is an allowed operator name,
205205
but <literal>*-</literal> is not.

src/backend/parser/gram.y

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.185 2000/08/11 23:45:27 tgl Exp $
14+
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.186 2000/08/12 05:15:21 tgl Exp $
1515
*
1616
* HISTORY
1717
* AUTHOR DATE MAJOR EVENT
@@ -363,7 +363,8 @@ static void doNegateFloat(Value *v);
363363
/* these are not real. they are here so that they get generated as #define's*/
364364
%token OP
365365

366-
/* precedence */
366+
/* precedence: lowest to highest */
367+
%left UNION INTERSECT EXCEPT
367368
%left OR
368369
%left AND
369370
%right NOT
@@ -381,15 +382,12 @@ static void doNegateFloat(Value *v);
381382
%left '+' '-'
382383
%left '*' '/' '%'
383384
%left '^'
384-
%left '|' /* this is the relation union op, not logical or */
385+
%left '|' /* XXX Should this have such a high priority? */
385386
/* Unary Operators */
386-
%right ':' /* delimiter for array ranges */
387-
%left ';' /* end of statement */
388387
%right UMINUS
389388
%left '.'
390389
%left '[' ']'
391390
%left TYPECAST
392-
%left UNION INTERSECT EXCEPT
393391
%left ESCAPE
394392
%%
395393

src/backend/parser/scan.l

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.74 2000/08/06 17:50:38 thomas Exp $
12+
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.75 2000/08/12 05:15:21 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -181,7 +181,7 @@ typecast "::"
181181
* rule for "operator"!
182182
*/
183183
self [,()\[\].;$\:\+\-\*\/\%\^\<\>\=\|]
184-
op_chars [\~\!\@\#\^\&\|\`\?\$\:\+\-\*\/\%\<\>\=]
184+
op_chars [\~\!\@\#\^\&\|\`\?\$\+\-\*\/\%\<\>\=]
185185
operator {op_chars}+
186186

187187
/* we no longer allow unary minus in numbers.
@@ -402,7 +402,7 @@ other .
402402

403403
for (ic = nchars-2; ic >= 0; ic--)
404404
{
405-
if (strchr("~!@#&`?$:%^|", yytext[ic]))
405+
if (strchr("~!@#^&|`?$%", yytext[ic]))
406406
break;
407407
}
408408
if (ic >= 0)

src/include/catalog/pg_operator.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $Id: pg_operator.h,v 1.79 2000/07/30 22:13:59 tgl Exp $
11+
* $Id: pg_operator.h,v 1.80 2000/08/12 05:15:22 tgl Exp $
1212
*
1313
* NOTES
1414
* the genbki.sh script reads this file and generates .bki
@@ -275,8 +275,6 @@ DATA(insert OID = 596 ( "|/" PGUID 0 l t f 0 701 701 0 0 0 0 dsqrt
275275
DATA(insert OID = 597 ( "||/" PGUID 0 l t f 0 701 701 0 0 0 0 dcbrt - - ));
276276
DATA(insert OID = 598 ( "%" PGUID 0 l t f 0 701 701 0 0 0 0 dtrunc - - ));
277277
DATA(insert OID = 599 ( "%" PGUID 0 r t f 701 0 701 0 0 0 0 dround - - ));
278-
DATA(insert OID = 1282 ( ":" PGUID 0 l t f 0 701 701 0 0 0 0 dexp - - ));
279-
DATA(insert OID = 1283 ( ";" PGUID 0 l t f 0 701 701 0 0 0 0 dlog1 - - ));
280278
DATA(insert OID = 1284 ( "|" PGUID 0 l t f 0 704 702 0 0 0 0 tintervalstart - - ));
281279
DATA(insert OID = 606 ( "<#>" PGUID 0 b t f 702 702 704 0 0 0 0 mktinterval - - ));
282280
DATA(insert OID = 607 ( "=" PGUID 0 b t t 26 26 16 607 608 609 609 oideq eqsel eqjoinsel ));

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy