|
1 | 1 | <!--
|
2 |
| -$PostgreSQL: pgsql/doc/src/sgml/syntax.sgml,v 1.103 2005/08/14 22:19:50 petere Exp $ |
| 2 | +$PostgreSQL: pgsql/doc/src/sgml/syntax.sgml,v 1.104 2005/10/23 19:29:49 tgl Exp $ |
3 | 3 | -->
|
4 | 4 |
|
5 | 5 | <chapter id="sql-syntax">
|
@@ -260,7 +260,7 @@ UPDATE "my_table" SET "a" = 5;
|
260 | 260 | <literal>\n</literal> is a newline, <literal>\r</literal> is a
|
261 | 261 | carriage return, <literal>\t</literal> is a tab. Also supported is
|
262 | 262 | <literal>\<replaceable>digits</replaceable></literal>, where
|
263 |
| - <replaceable>ddd</replaceable> represents an octal byte value, and |
| 263 | + <replaceable>digits</replaceable> represents an octal byte value, and |
264 | 264 | <literal>\x<replaceable>hexdigits</replaceable></literal>, where
|
265 | 265 | <replaceable>hexdigits</replaceable> represents a hexadecimal byte value.
|
266 | 266 | (It is your responsibility that the byte sequences you create are
|
@@ -544,6 +544,16 @@ CAST ( '<replaceable>string</replaceable>' AS <replaceable>type</replaceable> )
|
544 | 544 | is that it does not work for array types; use <literal>::</literal>
|
545 | 545 | or <literal>CAST()</literal> to specify the type of an array constant.
|
546 | 546 | </para>
|
| 547 | + |
| 548 | + <para> |
| 549 | + The <literal>CAST()</> syntax conforms to SQL. The |
| 550 | + <literal><replaceable>type</replaceable> '<replaceable>string</replaceable>'</literal> |
| 551 | + syntax is a generalization of the standard: SQL specifies this syntax only |
| 552 | + for a few datatypes, but <productname>PostgreSQL</productname> allows it |
| 553 | + for all types. The syntax with |
| 554 | + <literal>::</literal> is historical <productname>PostgreSQL</productname> |
| 555 | + usage, as is the function-call syntax. |
| 556 | + </para> |
547 | 557 | </sect3>
|
548 | 558 | </sect2>
|
549 | 559 |
|
@@ -1105,8 +1115,8 @@ CREATE FUNCTION dept(text) RETURNS dept
|
1105 | 1115 | LANGUAGE SQL;
|
1106 | 1116 | </programlisting>
|
1107 | 1117 |
|
1108 |
| - Here the <literal>$1</literal> will be replaced by the first |
1109 |
| - function argument when the function is invoked. |
| 1118 | + Here the <literal>$1</literal> references the value of the first |
| 1119 | + function argument whenever the function is invoked. |
1110 | 1120 | </para>
|
1111 | 1121 | </sect2>
|
1112 | 1122 |
|
|
0 commit comments