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.
This commit is contained in:
Tom Lane 2000-08-12 05:15:24 +00:00
parent 134fdf34d6
commit 766fb7f707
5 changed files with 28 additions and 79 deletions

View File

@ -1,5 +1,5 @@
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/oper.sgml,v 1.16 2000/05/02 20:01:52 thomas Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/oper.sgml,v 1.17 2000/08/12 05:15:24 tgl Exp $
--> -->
<Chapter Id="operators"> <Chapter Id="operators">
@ -83,20 +83,10 @@ Operator Ordering (decreasing precedence)
<tbody> <tbody>
<row> <row>
<entry> <entry>
UNION
</entry>
<entry>
left
</entry>
<entry>
SQL select construct
</entry>
</row>
<row>
<entry>
:: ::
</entry> </entry>
<entry> <entry>
left
</entry> </entry>
<entry> <entry>
<productname>Postgres</productname> typecasting <productname>Postgres</productname> typecasting
@ -135,31 +125,6 @@ right
unary minus unary minus
</entry> </entry>
</row> </row>
<!--
Deprecated as of v7.0
<row>
<entry>
;
</entry>
<entry>
left
</entry>
<entry>
statement termination, logarithm
</entry>
</row>
-->
<row>
<entry>
:
</entry>
<entry>
right
</entry>
<entry>
exponentiation
</entry>
</row>
<row> <row>
<entry> <entry>
| |
@ -173,6 +138,17 @@ start of interval
</row> </row>
<row> <row>
<entry> <entry>
^
</entry>
<entry>
left
</entry>
<entry>
power, exclusive or
</entry>
</row>
<row>
<entry>
* / % * / %
</entry> </entry>
<entry> <entry>
@ -228,6 +204,7 @@ test for NOT NULL
(all other operators) (all other operators)
</entry> </entry>
<entry> <entry>
left
</entry> </entry>
<entry> <entry>
native and user-defined native and user-defined
@ -265,7 +242,7 @@ time interval overlap
</row> </row>
<row> <row>
<entry> <entry>
LIKE LIKE ILIKE
</entry> </entry>
<entry> <entry>
</entry> </entry>
@ -486,19 +463,6 @@ logical union
<ENTRY>Division</ENTRY> <ENTRY>Division</ENTRY>
<ENTRY>4 / 2</ENTRY> <ENTRY>4 / 2</ENTRY>
</ROW> </ROW>
<ROW>
<ENTRY> : </ENTRY>
<ENTRY>Natural Exponentiation</ENTRY>
<ENTRY>: 3.0</ENTRY>
</ROW>
<!--
Deprecated in v7.0, esp. since ln() is available as a generic function.
<ROW>
<ENTRY> ; </ENTRY>
<ENTRY>Natural Logarithm</ENTRY>
<ENTRY>(; 5.0)</ENTRY>
</ROW>
-->
<ROW> <ROW>
<ENTRY> @ </ENTRY> <ENTRY> @ </ENTRY>
<ENTRY>Absolute value</ENTRY> <ENTRY>Absolute value</ENTRY>
@ -523,17 +487,6 @@ Deprecated in v7.0, esp. since ln() is available as a generic function.
</TGROUP> </TGROUP>
</TABLE> </TABLE>
</Para> </Para>
<para>
<note>
<para>
Two operators, ":" and ";", are now deprecated and will be removed in
the next release. Use the equivalent functions exp() and ln()
instead.
</para>
</note>
</para>
</sect1> </sect1>
<sect1> <sect1>

View File

@ -1,5 +1,5 @@
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_operator.sgml,v 1.14 2000/07/21 17:58:49 momjian Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/create_operator.sgml,v 1.15 2000/08/12 05:15:23 tgl Exp $
Postgres documentation Postgres documentation
--> -->
@ -177,15 +177,15 @@ CREATE
is a sequence of up to NAMEDATALEN-1 (31 by default) characters is a sequence of up to NAMEDATALEN-1 (31 by default) characters
from the following list: from the following list:
<literallayout> <literallayout>
+ - * / &lt; &gt; = ~ ! @ # % ^ &amp; | ` ? $ : + - * / &lt; &gt; = ~ ! @ # % ^ &amp; | ` ? $
</literallayout> </literallayout>
There are a few restrictions on your choice of name: There are a few restrictions on your choice of name:
<itemizedlist> <itemizedlist>
<listitem> <listitem>
<para> <para>
"$" and ":" cannot be defined as single-character operators, "$" cannot be defined as a single-character operator,
although they can be part of a multi-character operator name. although it can be part of a multi-character operator name.
</para> </para>
</listitem> </listitem>
<listitem> <listitem>
@ -199,7 +199,7 @@ CREATE
A multi-character operator name cannot end in "+" or "-", A multi-character operator name cannot end in "+" or "-",
unless the name also contains at least one of these characters: unless the name also contains at least one of these characters:
<literallayout> <literallayout>
~ ! @ # % ^ &amp; | ` ? $ : ~ ! @ # % ^ &amp; | ` ? $
</literallayout> </literallayout>
For example, <literal>@-</literal> is an allowed operator name, For example, <literal>@-</literal> is an allowed operator name,
but <literal>*-</literal> is not. but <literal>*-</literal> is not.

View File

@ -11,7 +11,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.185 2000/08/11 23:45:27 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.186 2000/08/12 05:15:21 tgl Exp $
* *
* HISTORY * HISTORY
* AUTHOR DATE MAJOR EVENT * AUTHOR DATE MAJOR EVENT
@ -363,7 +363,8 @@ static void doNegateFloat(Value *v);
/* these are not real. they are here so that they get generated as #define's*/ /* these are not real. they are here so that they get generated as #define's*/
%token OP %token OP
/* precedence */ /* precedence: lowest to highest */
%left UNION INTERSECT EXCEPT
%left OR %left OR
%left AND %left AND
%right NOT %right NOT
@ -381,15 +382,12 @@ static void doNegateFloat(Value *v);
%left '+' '-' %left '+' '-'
%left '*' '/' '%' %left '*' '/' '%'
%left '^' %left '^'
%left '|' /* this is the relation union op, not logical or */ %left '|' /* XXX Should this have such a high priority? */
/* Unary Operators */ /* Unary Operators */
%right ':' /* delimiter for array ranges */
%left ';' /* end of statement */
%right UMINUS %right UMINUS
%left '.' %left '.'
%left '[' ']' %left '[' ']'
%left TYPECAST %left TYPECAST
%left UNION INTERSECT EXCEPT
%left ESCAPE %left ESCAPE
%% %%

View File

@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.74 2000/08/06 17:50:38 thomas Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.75 2000/08/12 05:15:21 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
@ -181,7 +181,7 @@ typecast "::"
* rule for "operator"! * rule for "operator"!
*/ */
self [,()\[\].;$\:\+\-\*\/\%\^\<\>\=\|] self [,()\[\].;$\:\+\-\*\/\%\^\<\>\=\|]
op_chars [\~\!\@\#\^\&\|\`\?\$\:\+\-\*\/\%\<\>\=] op_chars [\~\!\@\#\^\&\|\`\?\$\+\-\*\/\%\<\>\=]
operator {op_chars}+ operator {op_chars}+
/* we no longer allow unary minus in numbers. /* we no longer allow unary minus in numbers.
@ -402,7 +402,7 @@ other .
for (ic = nchars-2; ic >= 0; ic--) for (ic = nchars-2; ic >= 0; ic--)
{ {
if (strchr("~!@#&`?$:%^|", yytext[ic])) if (strchr("~!@#^&|`?$%", yytext[ic]))
break; break;
} }
if (ic >= 0) if (ic >= 0)

View File

@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: pg_operator.h,v 1.79 2000/07/30 22:13:59 tgl Exp $ * $Id: pg_operator.h,v 1.80 2000/08/12 05:15:22 tgl Exp $
* *
* NOTES * NOTES
* the genbki.sh script reads this file and generates .bki * 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
DATA(insert OID = 597 ( "||/" PGUID 0 l t f 0 701 701 0 0 0 0 dcbrt - - )); DATA(insert OID = 597 ( "||/" PGUID 0 l t f 0 701 701 0 0 0 0 dcbrt - - ));
DATA(insert OID = 598 ( "%" PGUID 0 l t f 0 701 701 0 0 0 0 dtrunc - - )); DATA(insert OID = 598 ( "%" PGUID 0 l t f 0 701 701 0 0 0 0 dtrunc - - ));
DATA(insert OID = 599 ( "%" PGUID 0 r t f 701 0 701 0 0 0 0 dround - - )); DATA(insert OID = 599 ( "%" PGUID 0 r t f 701 0 701 0 0 0 0 dround - - ));
DATA(insert OID = 1282 ( ":" PGUID 0 l t f 0 701 701 0 0 0 0 dexp - - ));
DATA(insert OID = 1283 ( ";" PGUID 0 l t f 0 701 701 0 0 0 0 dlog1 - - ));
DATA(insert OID = 1284 ( "|" PGUID 0 l t f 0 704 702 0 0 0 0 tintervalstart - - )); DATA(insert OID = 1284 ( "|" PGUID 0 l t f 0 704 702 0 0 0 0 tintervalstart - - ));
DATA(insert OID = 606 ( "<#>" PGUID 0 b t f 702 702 704 0 0 0 0 mktinterval - - )); DATA(insert OID = 606 ( "<#>" PGUID 0 b t f 702 702 704 0 0 0 0 mktinterval - - ));
DATA(insert OID = 607 ( "=" PGUID 0 b t t 26 26 16 607 608 609 609 oideq eqsel eqjoinsel )); DATA(insert OID = 607 ( "=" PGUID 0 b t t 26 26 16 607 608 609 609 oideq eqsel eqjoinsel ));