aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-06-19 23:22:40 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-06-19 23:22:40 +0000
commit1bd22f55cf1e5e80ab0b7704adf9678cacaca69b (patch)
treed5e2f96c458ef93fa9ee93c4419bdbaf333f4787 /src/backend
parent8902aaaa6cbe0776a3214b4ae88602263b2a150e (diff)
downloadpostgresql-1bd22f55cf1e5e80ab0b7704adf9678cacaca69b.tar.gz
postgresql-1bd22f55cf1e5e80ab0b7704adf9678cacaca69b.zip
Disallow dollar sign in operator names, instead allow it as a non-first
character in identifiers. The first change eliminates the current need to put spaces around parameter references, as in "x<=$2". The second change improves compatibility with Oracle and some other RDBMSes. This was discussed and agreed to back in January, but did not get done.
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/parser/scan.l16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/backend/parser/scan.l b/src/backend/parser/scan.l
index 083c19e650c..6aa2676e205 100644
--- a/src/backend/parser/scan.l
+++ b/src/backend/parser/scan.l
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.107 2003/05/29 22:30:02 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.108 2003/06/19 23:22:40 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -174,10 +174,10 @@ xcstop \*+\/
xcinside [^*/]+
digit [0-9]
-letter [\200-\377_A-Za-z]
-letter_or_digit [\200-\377_A-Za-z0-9]
+ident_start [A-Za-z\200-\377_]
+ident_cont [A-Za-z\200-\377_0-9\$]
-identifier {letter}{letter_or_digit}*
+identifier {ident_start}{ident_cont}*
typecast "::"
@@ -191,8 +191,8 @@ typecast "::"
* If you change either set, adjust the character lists appearing in the
* rule for "operator"!
*/
-self [,()\[\].;$\:\+\-\*\/\%\^\<\>\=]
-op_chars [\~\!\@\#\^\&\|\`\?\$\+\-\*\/\%\<\>\=]
+self [,()\[\].;\:\+\-\*\/\%\^\<\>\=]
+op_chars [\~\!\@\#\^\&\|\`\?\+\-\*\/\%\<\>\=]
operator {op_chars}+
/* we no longer allow unary minus in numbers.
@@ -461,7 +461,7 @@ other .
for (ic = nchars-2; ic >= 0; ic--)
{
- if (strchr("~!@#^&|`?$%", yytext[ic]))
+ if (strchr("~!@#^&|`?%", yytext[ic]))
break;
}
if (ic >= 0)
@@ -480,7 +480,7 @@ other .
* that the "self" rule would have.
*/
if (nchars == 1 &&
- strchr(",()[].;$:+-*/%^<>=", yytext[0]))
+ strchr(",()[].;:+-*/%^<>=", yytext[0]))
return yytext[0];
}