<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/release.sgml,v 1.193 2003/06/17 23:12:36 tgl Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/release.sgml,v 1.194 2003/06/19 23:22:40 tgl Exp $
-->
<appendix id="release">
worries about funny characters.
-->
<literallayout><![CDATA[
+Dollar sign ($) is no longer allowed in operator names
+Dollar sign ($) can be a non-first character in identifiers
Precision in FLOAT(p) is now interpreted as bits, not decimal digits
Functional indexes have been generalized into expressional indexes
CHAR(n) to TEXT conversion automatically strips trailing blanks
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/syntax.sgml,v 1.78 2003/06/06 15:04:01 tgl Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/syntax.sgml,v 1.79 2003/06/19 23:22:40 tgl Exp $
-->
<chapter id="sql-syntax">
(<literal>a</literal>-<literal>z</literal>, but also letters with
diacritical marks and non-Latin letters) or an underscore
(<literal>_</literal>). Subsequent characters in an identifier or
- key word can be letters, digits
- (<literal>0</literal>-<literal>9</literal>), or underscores,
- although the SQL standard will not define a key word that contains
- digits or starts or ends with an underscore.
+ key word can be letters, underscores, digits
+ (<literal>0</literal>-<literal>9</literal>), or dollar signs
+ (<literal>$</>). Note that dollar signs are not allowed in identifiers
+ according to the letter of the SQL standard, so their use may render
+ applications less portable.
+ The SQL standard will not define a key word that contains
+ digits or starts or ends with an underscore, so identifiers of this
+ form are safe against possible conflict with future extensions of the
+ standard.
</para>
<para>
An operator is a sequence of up to <symbol>NAMEDATALEN</symbol>-1
(63 by default) characters from the following list:
<literallayout>
-+ - * / < > = ~ ! @ # % ^ & | ` ? $
++ - * / < > = ~ ! @ # % ^ & | ` ?
</literallayout>
There are a few restrictions on operator names, however:
<itemizedlist>
<listitem>
<para>
- <literal>$</> (dollar) cannot be a single-character operator, although it
- can be part of a multiple-character operator name.
- </para>
- </listitem>
-
- <listitem>
- <para>
<literal>--</literal> and <literal>/*</literal> cannot appear
anywhere in an operator name, since they will be taken as the
start of a comment.
A multiple-character operator name cannot end in <literal>+</> or <literal>-</>,
unless the name also contains at least one of these characters:
<literallayout>
-~ ! @ # % ^ & | ` ? $
+~ ! @ # % ^ & | ` ?
</literallayout>
For example, <literal>@-</literal> is an allowed operator name,
but <literal>*-</literal> is not. This restriction allows
<listitem>
<para>
A dollar sign (<literal>$</literal>) followed by digits is used
- to represent the positional parameters in the body of a function
+ to represent a positional parameter in the body of a function
definition or a prepared statement. In other contexts the
- dollar sign may be part of an operator name.
+ dollar sign may be part of an identifier.
</para>
</listitem>
<title>Positional Parameters</title>
<para>
- A positional parameter reference is used to indicate a parameter
+ A positional parameter reference is used to indicate a value
that is supplied externally to an SQL statement. Parameters are
- used in SQL function definitions and in prepared queries.
+ used in SQL function definitions and in prepared queries. Some
+ client libraries also support specifying data values separately
+ from the SQL command string, in which case parameters are used to
+ refer to the out-of-line data values.
The form of a parameter reference is:
<synopsis>
$<replaceable>number</replaceable>
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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 "::"
* 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.
for (ic = nchars-2; ic >= 0; ic--)
{
- if (strchr("~!@#^&|`?$%", yytext[ic]))
+ if (strchr("~!@#^&|`?%", yytext[ic]))
break;
}
if (ic >= 0)
* that the "self" rule would have.
*/
if (nchars == 1 &&
- strchr(",()[].;$:+-*/%^<>=", yytext[0]))
+ strchr(",()[].;:+-*/%^<>=", yytext[0]))
return yytext[0];
}
* procedural language
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/scan.l,v 1.27 2003/06/17 04:35:03 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/scan.l,v 1.28 2003/06/19 23:22:40 tgl Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
%x IN_STRING IN_COMMENT
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\$]
quoted_ident (\"[^\"]*\")+
-identifier ({letter}{letter_or_digit}*|{quoted_ident})
+identifier ({ident_start}{ident_cont}*|{quoted_ident})
+
+param \${digit}+
space [ \t\n\r\f]
{identifier}{space}*\.{space}*{identifier}{space}*%ROWTYPE {
plpgsql_error_lineno = plpgsql_scanner_lineno();
return plpgsql_parse_dblwordrowtype(yytext); }
-\${digit}+ {
+{param} {
plpgsql_error_lineno = plpgsql_scanner_lineno();
return plpgsql_parse_word(yytext); }
-\${digit}+{space}*\.{space}*{identifier} {
+{param}{space}*\.{space}*{identifier} {
plpgsql_error_lineno = plpgsql_scanner_lineno();
return plpgsql_parse_dblword(yytext); }
-\${digit}+{space}*\.{space}*{identifier}{space}*\.{space}*{identifier} {
+{param}{space}*\.{space}*{identifier}{space}*\.{space}*{identifier} {
plpgsql_error_lineno = plpgsql_scanner_lineno();
return plpgsql_parse_tripword(yytext); }
-\${digit}+{space}*%TYPE {
+{param}{space}*%TYPE {
plpgsql_error_lineno = plpgsql_scanner_lineno();
return plpgsql_parse_wordtype(yytext); }
-\${digit}+{space}*\.{space}*{identifier}{space}*%TYPE {
+{param}{space}*\.{space}*{identifier}{space}*%TYPE {
plpgsql_error_lineno = plpgsql_scanner_lineno();
return plpgsql_parse_dblwordtype(yytext); }
-\${digit}+{space}*\.{space}*{identifier}{space}*\.{space}*{identifier}{space}*%TYPE {
+{param}{space}*\.{space}*{identifier}{space}*\.{space}*{identifier}{space}*%TYPE {
plpgsql_error_lineno = plpgsql_scanner_lineno();
return plpgsql_parse_tripwordtype(yytext); }
-\${digit}+{space}*%ROWTYPE {
+{param}{space}*%ROWTYPE {
plpgsql_error_lineno = plpgsql_scanner_lineno();
return plpgsql_parse_wordrowtype(yytext); }
-\${digit}+{space}*\.{space}*{identifier}{space}*%ROWTYPE {
+{param}{space}*\.{space}*{identifier}{space}*%ROWTYPE {
plpgsql_error_lineno = plpgsql_scanner_lineno();
return plpgsql_parse_dblwordrowtype(yytext); }