aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2010-05-30 18:10:41 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2010-05-30 18:10:41 +0000
commitb12b7a9038259967098159cf0ccce0e77327a4d1 (patch)
treee6ff349cfd79edf3d06a76fac70c247a56e997cb /doc/src
parent2bde07c198a4995a4a756c58ee65d030a0e6ee02 (diff)
downloadpostgresql-b12b7a9038259967098159cf0ccce0e77327a4d1.tar.gz
postgresql-b12b7a9038259967098159cf0ccce0e77327a4d1.zip
Change the notation for calling functions with named parameters from
"val AS name" to "name := val", as per recent discussion. This patch catches everything in the original named-parameters patch, but I'm not certain that no other dependencies snuck in later (grepping the source tree for all uses of AS soon proved unworkable). In passing I note that we've dropped the ball at least once on keeping ecpg's lexer (as opposed to parser) in sync with the backend. It would be a good idea to go through all of pgc.l and see if it's in sync now. I didn't attempt that at the moment.
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/syntax.sgml15
-rw-r--r--doc/src/sgml/xfunc.sgml8
2 files changed, 12 insertions, 11 deletions
diff --git a/doc/src/sgml/syntax.sgml b/doc/src/sgml/syntax.sgml
index c9fa642345c..8f6b728aa03 100644
--- a/doc/src/sgml/syntax.sgml
+++ b/doc/src/sgml/syntax.sgml
@@ -1,4 +1,4 @@
-<!-- $PostgreSQL: pgsql/doc/src/sgml/syntax.sgml,v 1.144 2010/05/27 18:23:47 petere Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/syntax.sgml,v 1.145 2010/05/30 18:10:40 tgl Exp $ -->
<chapter id="sql-syntax">
<title>SQL Syntax</title>
@@ -2285,10 +2285,11 @@ SELECT concat_lower_or_upper('Hello', 'World');
</indexterm>
<para>
- In named notation, each argument's name is specified using the
- <literal>AS</literal> keyword. For example:
+ In named notation, each argument's name is specified using
+ <literal>:=</literal> to separate it from the argument expression.
+ For example:
<screen>
-SELECT concat_lower_or_upper('Hello' AS a, 'World' AS b);
+SELECT concat_lower_or_upper(a := 'Hello', b := 'World');
concat_lower_or_upper
-----------------------
hello world
@@ -2299,13 +2300,13 @@ SELECT concat_lower_or_upper('Hello' AS a, 'World' AS b);
using named notation is that the arguments may be specified in any
order, for example:
<screen>
-SELECT concat_lower_or_upper('Hello' AS a, 'World' AS b, true AS uppercase);
+SELECT concat_lower_or_upper(a := 'Hello', b := 'World', uppercase := true);
concat_lower_or_upper
-----------------------
HELLO WORLD
(1 row)
-SELECT concat_lower_or_upper('Hello' AS a, true AS uppercase, 'World' AS b);
+SELECT concat_lower_or_upper(a := 'Hello', uppercase := true, b := 'World');
concat_lower_or_upper
-----------------------
HELLO WORLD
@@ -2327,7 +2328,7 @@ SELECT concat_lower_or_upper('Hello' AS a, true AS uppercase, 'World' AS b);
already mentioned, named arguments cannot precede positional arguments.
For example:
<screen>
-SELECT concat_lower_or_upper('Hello', 'World', true AS uppercase);
+SELECT concat_lower_or_upper('Hello', 'World', uppercase := true);
concat_lower_or_upper
-----------------------
HELLO WORLD
diff --git a/doc/src/sgml/xfunc.sgml b/doc/src/sgml/xfunc.sgml
index c422fcc78a8..b2795c2cf09 100644
--- a/doc/src/sgml/xfunc.sgml
+++ b/doc/src/sgml/xfunc.sgml
@@ -1,4 +1,4 @@
-<!-- $PostgreSQL: pgsql/doc/src/sgml/xfunc.sgml,v 1.148 2010/05/16 04:35:04 rhaas Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/xfunc.sgml,v 1.149 2010/05/30 18:10:40 tgl Exp $ -->
<sect1 id="xfunc">
<title>User-Defined Functions</title>
@@ -705,14 +705,14 @@ SELECT mleast(VARIADIC ARRAY[10, -1, 5, 4.4]);
<literal>VARIADIC</>. For example, this will work:
<screen>
-SELECT mleast(VARIADIC ARRAY[10, -1, 5, 4.4] AS arr);
+SELECT mleast(VARIADIC arr := ARRAY[10, -1, 5, 4.4]);
</screen>
but not these:
<screen>
-SELECT mleast(10 AS arr);
-SELECT mleast(ARRAY[10, -1, 5, 4.4] AS arr);
+SELECT mleast(arr := 10);
+SELECT mleast(arr := ARRAY[10, -1, 5, 4.4]);
</screen>
</para>
</sect2>