aboutsummaryrefslogtreecommitdiff
path: root/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 /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 'src')
-rw-r--r--src/backend/parser/gram.y16
-rw-r--r--src/backend/parser/parse_func.c6
-rw-r--r--src/backend/parser/scan.l4
-rw-r--r--src/backend/utils/adt/ruleutils.c4
-rw-r--r--src/bin/psql/psqlscan.l4
-rw-r--r--src/interfaces/ecpg/preproc/parse.pl4
-rw-r--r--src/interfaces/ecpg/preproc/pgc.l6
-rw-r--r--src/test/regress/expected/polymorphism.out82
-rw-r--r--src/test/regress/sql/polymorphism.sql58
9 files changed, 93 insertions, 91 deletions
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 368586a95e6..c75bc825a8d 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.711 2010/02/23 22:51:42 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.712 2010/05/30 18:10:40 tgl Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -444,8 +444,8 @@ static TypeName *TableFuncTypeName(List *columns);
* the set of keywords. PL/pgsql depends on this so that it can share the
* same lexer. If you add/change tokens here, fix PL/pgsql to match!
*
- * DOT_DOT and COLON_EQUALS are unused in the core SQL grammar, and so will
- * always provoke parse errors. They are needed by PL/pgsql.
+ * DOT_DOT is unused in the core SQL grammar, and so will always provoke
+ * parse errors. It is needed by PL/pgsql.
*/
%token <str> IDENT FCONST SCONST BCONST XCONST Op
%token <ival> ICONST PARAM
@@ -10212,13 +10212,13 @@ func_arg_expr: a_expr
{
$$ = $1;
}
- | a_expr AS param_name
+ | param_name COLON_EQUALS a_expr
{
NamedArgExpr *na = makeNode(NamedArgExpr);
- na->arg = (Expr *) $1;
- na->name = $3;
+ na->name = $1;
+ na->arg = (Expr *) $3;
na->argnumber = -1; /* until determined */
- na->location = @3;
+ na->location = @1;
$$ = (Node *) na;
}
;
@@ -10698,7 +10698,7 @@ AexprConst: Iconst
if (IsA(arg, NamedArgExpr))
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
- errmsg("type modifier cannot have AS name"),
+ errmsg("type modifier cannot have parameter name"),
parser_errposition(arg->location)));
}
t->typmods = $3;
diff --git a/src/backend/parser/parse_func.c b/src/backend/parser/parse_func.c
index 8a2663c232c..5de08dc78c8 100644
--- a/src/backend/parser/parse_func.c
+++ b/src/backend/parser/parse_func.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/parse_func.c,v 1.223 2010/03/17 16:52:38 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/parse_func.c,v 1.224 2010/05/30 18:10:40 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1386,12 +1386,12 @@ funcname_signature_string(const char *funcname, int nargs,
{
if (i)
appendStringInfoString(&argbuf, ", ");
- appendStringInfoString(&argbuf, format_type_be(argtypes[i]));
if (i >= numposargs)
{
- appendStringInfo(&argbuf, " AS %s", (char *) lfirst(lc));
+ appendStringInfo(&argbuf, "%s := ", (char *) lfirst(lc));
lc = lnext(lc);
}
+ appendStringInfoString(&argbuf, format_type_be(argtypes[i]));
}
appendStringInfoChar(&argbuf, ')');
diff --git a/src/backend/parser/scan.l b/src/backend/parser/scan.l
index b09187a2c02..81502adc95e 100644
--- a/src/backend/parser/scan.l
+++ b/src/backend/parser/scan.l
@@ -24,7 +24,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/scan.l,v 1.166 2010/01/16 17:39:55 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/scan.l,v 1.167 2010/05/30 18:10:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -317,8 +317,6 @@ ident_cont [A-Za-z\200-\377_0-9\$]
identifier {ident_start}{ident_cont}*
typecast "::"
-
-/* these two token types are used by PL/pgsql, though not in core SQL */
dot_dot \.\.
colon_equals ":="
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index 316562537be..54b6018d8e4 100644
--- a/src/backend/utils/adt/ruleutils.c
+++ b/src/backend/utils/adt/ruleutils.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.325 2010/02/26 02:01:09 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.326 2010/05/30 18:10:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -4537,8 +4537,8 @@ get_rule_expr(Node *node, deparse_context *context,
{
NamedArgExpr *na = (NamedArgExpr *) node;
+ appendStringInfo(buf, "%s := ", quote_identifier(na->name));
get_rule_expr((Node *) na->arg, context, showimplicit);
- appendStringInfo(buf, " AS %s", quote_identifier(na->name));
}
break;
diff --git a/src/bin/psql/psqlscan.l b/src/bin/psql/psqlscan.l
index cef0e73e9f9..8c105c11ed1 100644
--- a/src/bin/psql/psqlscan.l
+++ b/src/bin/psql/psqlscan.l
@@ -33,7 +33,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/bin/psql/psqlscan.l,v 1.33 2010/05/05 22:18:56 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/psqlscan.l,v 1.34 2010/05/30 18:10:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -345,8 +345,6 @@ ident_cont [A-Za-z\200-\377_0-9\$]
identifier {ident_start}{ident_cont}*
typecast "::"
-
-/* these two token types are used by PL/pgsql, though not in core SQL */
dot_dot \.\.
colon_equals ":="
diff --git a/src/interfaces/ecpg/preproc/parse.pl b/src/interfaces/ecpg/preproc/parse.pl
index 0db79227f48..30217a35dc6 100644
--- a/src/interfaces/ecpg/preproc/parse.pl
+++ b/src/interfaces/ecpg/preproc/parse.pl
@@ -1,5 +1,5 @@
#!/usr/bin/perl
-# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/parse.pl,v 1.7 2010/01/02 16:58:11 momjian Exp $
+# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/parse.pl,v 1.8 2010/05/30 18:10:41 tgl Exp $
# parser generater for ecpg
# call with backend parser as stdin
#
@@ -41,6 +41,8 @@ $replace_string{'WITH_TIME'} = 'with time';
$replace_string{'NULLS_FIRST'} = 'nulls first';
$replace_string{'NULLS_LAST'} = 'nulls last';
$replace_string{'TYPECAST'} = '::';
+$replace_string{'DOT_DOT'} = '..';
+$replace_string{'COLON_EQUALS'} = ':=';
# specific replace_types for specific non-terminals - never include the ':'
# ECPG-only replace_types are defined in ecpg-replace_types
diff --git a/src/interfaces/ecpg/preproc/pgc.l b/src/interfaces/ecpg/preproc/pgc.l
index cb00408752a..e0f112d3c4f 100644
--- a/src/interfaces/ecpg/preproc/pgc.l
+++ b/src/interfaces/ecpg/preproc/pgc.l
@@ -12,7 +12,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.173 2010/03/21 10:49:51 meskes Exp $
+ * $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.174 2010/05/30 18:10:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -230,6 +230,8 @@ identifier {ident_start}{ident_cont}*
array ({ident_cont}|{whitespace}|[\[\]\+\-\*\%\/\(\)\>\.])*
typecast "::"
+dot_dot \.\.
+colon_equals ":="
/*
* "self" is the set of chars that should be returned as single-character
@@ -595,6 +597,8 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})(.*\\{space})*.
}
<xdc>{xdcinside} { addlit(yytext, yyleng); }
<SQL>{typecast} { return TYPECAST; }
+<SQL>{dot_dot} { return DOT_DOT; }
+<SQL>{colon_equals} { return COLON_EQUALS; }
<SQL>{informix_special} {
/* are we simulating Informix? */
if (INFORMIX_MODE)
diff --git a/src/test/regress/expected/polymorphism.out b/src/test/regress/expected/polymorphism.out
index cc104522b0c..bae04a2719b 100644
--- a/src/test/regress/expected/polymorphism.out
+++ b/src/test/regress/expected/polymorphism.out
@@ -1052,19 +1052,19 @@ select (dfunc(10,20,30)).*;
10 | 20 | 30 | 0
(1 row)
-select (dfunc(10 as a, 20 as b, 30 as c)).*;
+select (dfunc(a := 10, b := 20, c := 30)).*;
a | b | c | d
----+----+----+---
10 | 20 | 30 | 0
(1 row)
-select * from dfunc(10 as a, 20 as b);
+select * from dfunc(a := 10, b := 20);
a | b | c | d
----+----+---+---
10 | 20 | 0 | 0
(1 row)
-select * from dfunc(10 as b, 20 as a);
+select * from dfunc(b := 10, a := 20);
a | b | c | d
----+----+---+---
20 | 10 | 0 | 0
@@ -1081,39 +1081,39 @@ select * from dfunc(1,2);
1 | 2 | 0 | 0
(1 row)
-select * from dfunc(1,2,3 as c);
+select * from dfunc(1,2,c := 3);
a | b | c | d
---+---+---+---
1 | 2 | 3 | 0
(1 row)
-select * from dfunc(1,2,3 as d);
+select * from dfunc(1,2,d := 3);
a | b | c | d
---+---+---+---
1 | 2 | 0 | 3
(1 row)
-select * from dfunc(10 as x, 20 as b, 30 as x); -- fail, duplicate name
+select * from dfunc(x := 20, b := 10, x := 30); -- fail, duplicate name
ERROR: argument name "x" used more than once
-LINE 1: select * from dfunc(10 as x, 20 as b, 30 as x);
- ^
-select * from dfunc(10, 20 as b, 30); -- fail, named args must be last
+LINE 1: select * from dfunc(x := 20, b := 10, x := 30);
+ ^
+select * from dfunc(10, b := 20, 30); -- fail, named args must be last
ERROR: positional argument cannot follow named argument
-LINE 1: select * from dfunc(10, 20 as b, 30);
+LINE 1: select * from dfunc(10, b := 20, 30);
^
-select * from dfunc(10 as x, 20 as b, 30 as c); -- fail, unknown param
-ERROR: function dfunc(integer AS x, integer AS b, integer AS c) does not exist
-LINE 1: select * from dfunc(10 as x, 20 as b, 30 as c);
+select * from dfunc(x := 10, b := 20, c := 30); -- fail, unknown param
+ERROR: function dfunc(x := integer, b := integer, c := integer) does not exist
+LINE 1: select * from dfunc(x := 10, b := 20, c := 30);
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
-select * from dfunc(10, 10, 20 as a); -- fail, a overlaps positional parameter
-ERROR: function dfunc(integer, integer, integer AS a) does not exist
-LINE 1: select * from dfunc(10, 10, 20 as a);
+select * from dfunc(10, 10, a := 20); -- fail, a overlaps positional parameter
+ERROR: function dfunc(integer, integer, a := integer) does not exist
+LINE 1: select * from dfunc(10, 10, a := 20);
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
-select * from dfunc(1,2 as c,3 as d); -- fail, no value for b
-ERROR: function dfunc(integer, integer AS c, integer AS d) does not exist
-LINE 1: select * from dfunc(1,2 as c,3 as d);
+select * from dfunc(1,c := 2,d := 3); -- fail, no value for b
+ERROR: function dfunc(integer, c := integer, d := integer) does not exist
+LINE 1: select * from dfunc(1,c := 2,d := 3);
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
drop function dfunc(int, int, int, int);
@@ -1134,27 +1134,27 @@ select * from dfunc('Hello World', 20, '2009-07-25'::date);
Hello World | 20 | 07-25-2009
(1 row)
-select * from dfunc('2009-07-25'::date as c, 'Hello World' as a, 20 as b);
+select * from dfunc(c := '2009-07-25'::date, a := 'Hello World', b := 20);
a | b | c
-------------+----+------------
Hello World | 20 | 07-25-2009
(1 row)
-select * from dfunc('Hello World', 20 as b, '2009-07-25'::date as c);
+select * from dfunc('Hello World', b := 20, c := '2009-07-25'::date);
a | b | c
-------------+----+------------
Hello World | 20 | 07-25-2009
(1 row)
-select * from dfunc('Hello World', '2009-07-25'::date as c, 20 as b);
+select * from dfunc('Hello World', c := '2009-07-25'::date, b := 20);
a | b | c
-------------+----+------------
Hello World | 20 | 07-25-2009
(1 row)
-select * from dfunc('Hello World', 20 as c, '2009-07-25'::date as b); -- fail
-ERROR: function dfunc(unknown, integer AS c, date AS b) does not exist
-LINE 1: select * from dfunc('Hello World', 20 as c, '2009-07-25'::da...
+select * from dfunc('Hello World', c := 20, b := '2009-07-25'::date); -- fail
+ERROR: function dfunc(unknown, c := integer, b := date) does not exist
+LINE 1: select * from dfunc('Hello World', c := 20, b := '2009-07-25...
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
drop function dfunc(varchar, numeric, date);
@@ -1181,13 +1181,13 @@ select * from dfunc('Hello', 100);
Hello | 100
(1 row)
-select * from dfunc('Hello' as a, 100 as c);
+select * from dfunc(a := 'Hello', c := 100);
_a | _c
-------+-----
Hello | 100
(1 row)
-select * from dfunc(100 as c, 'Hello' as a);
+select * from dfunc(c := 100, a := 'Hello');
_a | _c
-------+-----
Hello | 100
@@ -1199,13 +1199,13 @@ select * from dfunc('Hello');
Hello |
(1 row)
-select * from dfunc('Hello', 100 as c);
+select * from dfunc('Hello', c := 100);
_a | _c
-------+-----
Hello | 100
(1 row)
-select * from dfunc(100 as c);
+select * from dfunc(c := 100);
_a | _c
-------+-----
def a | 100
@@ -1268,43 +1268,43 @@ select dfunc('a'::text, 'b'); -- positional notation with default
a
(1 row)
-select dfunc(1 as a, 2 as b);
+select dfunc(a := 1, b := 2);
dfunc
-------
1
(1 row)
-select dfunc('a'::text as a, 'b' as b);
+select dfunc(a := 'a'::text, b := 'b');
dfunc
-------
a
(1 row)
-select dfunc('a'::text as a, 'b' as b, false as flag); -- named notation
+select dfunc(a := 'a'::text, b := 'b', flag := false); -- named notation
dfunc
-------
b
(1 row)
-select dfunc('b'::text as b, 'a' as a); -- named notation with default
+select dfunc(b := 'b'::text, a := 'a'); -- named notation with default
dfunc
-------
a
(1 row)
-select dfunc('a'::text as a, true as flag); -- named notation with default
+select dfunc(a := 'a'::text, flag := true); -- named notation with default
dfunc
-------
a
(1 row)
-select dfunc('a'::text as a, false as flag); -- named notation with default
+select dfunc(a := 'a'::text, flag := false); -- named notation with default
dfunc
-------
(1 row)
-select dfunc('b'::text as b, 'a' as a, true as flag); -- named notation
+select dfunc(b := 'b'::text, a := 'a', flag := true); -- named notation
dfunc
-------
a
@@ -1316,7 +1316,7 @@ select dfunc('a'::text, 'b', false); -- full positional notation
b
(1 row)
-select dfunc('a'::text, 'b', false as flag); -- mixed notation
+select dfunc('a'::text, 'b', flag := false); -- mixed notation
dfunc
-------
b
@@ -1328,7 +1328,7 @@ select dfunc('a'::text, 'b', true); -- full positional notation
a
(1 row)
-select dfunc('a'::text, 'b', true as flag); -- mixed notation
+select dfunc('a'::text, 'b', flag := true); -- mixed notation
dfunc
-------
a
@@ -1337,8 +1337,8 @@ select dfunc('a'::text, 'b', true as flag); -- mixed notation
-- check reverse-listing of named-arg calls
CREATE VIEW dfview AS
SELECT q1, q2,
- dfunc(q1,q2, q1>q2 as flag) as c3,
- dfunc(q1, q1<q2 as flag, q2 AS b) as c4
+ dfunc(q1,q2, flag := q1>q2) as c3,
+ dfunc(q1, flag := q1<q2, b := q2) as c4
FROM int8_tbl;
select * from dfview;
q1 | q2 | c3 | c4
@@ -1359,7 +1359,7 @@ select * from dfview;
c3 | bigint | | plain |
c4 | bigint | | plain |
View definition:
- SELECT int8_tbl.q1, int8_tbl.q2, dfunc(int8_tbl.q1, int8_tbl.q2, int8_tbl.q1 > int8_tbl.q2 AS flag) AS c3, dfunc(int8_tbl.q1, int8_tbl.q1 < int8_tbl.q2 AS flag, int8_tbl.q2 AS b) AS c4
+ SELECT int8_tbl.q1, int8_tbl.q2, dfunc(int8_tbl.q1, int8_tbl.q2, flag := int8_tbl.q1 > int8_tbl.q2) AS c3, dfunc(int8_tbl.q1, flag := int8_tbl.q1 < int8_tbl.q2, b := int8_tbl.q2) AS c4
FROM int8_tbl;
drop view dfview;
diff --git a/src/test/regress/sql/polymorphism.sql b/src/test/regress/sql/polymorphism.sql
index 3c8ab5d79b2..2baebe93235 100644
--- a/src/test/regress/sql/polymorphism.sql
+++ b/src/test/regress/sql/polymorphism.sql
@@ -636,19 +636,19 @@ create function dfunc(a int, b int, c int = 0, d int = 0)
$$ language sql;
select (dfunc(10,20,30)).*;
-select (dfunc(10 as a, 20 as b, 30 as c)).*;
-select * from dfunc(10 as a, 20 as b);
-select * from dfunc(10 as b, 20 as a);
+select (dfunc(a := 10, b := 20, c := 30)).*;
+select * from dfunc(a := 10, b := 20);
+select * from dfunc(b := 10, a := 20);
select * from dfunc(0); -- fail
select * from dfunc(1,2);
-select * from dfunc(1,2,3 as c);
-select * from dfunc(1,2,3 as d);
+select * from dfunc(1,2,c := 3);
+select * from dfunc(1,2,d := 3);
-select * from dfunc(10 as x, 20 as b, 30 as x); -- fail, duplicate name
-select * from dfunc(10, 20 as b, 30); -- fail, named args must be last
-select * from dfunc(10 as x, 20 as b, 30 as c); -- fail, unknown param
-select * from dfunc(10, 10, 20 as a); -- fail, a overlaps positional parameter
-select * from dfunc(1,2 as c,3 as d); -- fail, no value for b
+select * from dfunc(x := 20, b := 10, x := 30); -- fail, duplicate name
+select * from dfunc(10, b := 20, 30); -- fail, named args must be last
+select * from dfunc(x := 10, b := 20, c := 30); -- fail, unknown param
+select * from dfunc(10, 10, a := 20); -- fail, a overlaps positional parameter
+select * from dfunc(1,c := 2,d := 3); -- fail, no value for b
drop function dfunc(int, int, int, int);
@@ -660,10 +660,10 @@ $$ language sql;
select (dfunc('Hello World', 20, '2009-07-25'::date)).*;
select * from dfunc('Hello World', 20, '2009-07-25'::date);
-select * from dfunc('2009-07-25'::date as c, 'Hello World' as a, 20 as b);
-select * from dfunc('Hello World', 20 as b, '2009-07-25'::date as c);
-select * from dfunc('Hello World', '2009-07-25'::date as c, 20 as b);
-select * from dfunc('Hello World', 20 as c, '2009-07-25'::date as b); -- fail
+select * from dfunc(c := '2009-07-25'::date, a := 'Hello World', b := 20);
+select * from dfunc('Hello World', b := 20, c := '2009-07-25'::date);
+select * from dfunc('Hello World', c := '2009-07-25'::date, b := 20);
+select * from dfunc('Hello World', c := 20, b := '2009-07-25'::date); -- fail
drop function dfunc(varchar, numeric, date);
@@ -676,11 +676,11 @@ $$ language sql;
select (dfunc()).*;
select * from dfunc();
select * from dfunc('Hello', 100);
-select * from dfunc('Hello' as a, 100 as c);
-select * from dfunc(100 as c, 'Hello' as a);
+select * from dfunc(a := 'Hello', c := 100);
+select * from dfunc(c := 100, a := 'Hello');
select * from dfunc('Hello');
-select * from dfunc('Hello', 100 as c);
-select * from dfunc(100 as c);
+select * from dfunc('Hello', c := 100);
+select * from dfunc(c := 100);
-- fail, can no longer change an input parameter's name
create or replace function dfunc(a varchar = 'def a', out _a varchar, x numeric = NULL, out _c numeric)
@@ -718,25 +718,25 @@ $$ language sql;
select dfunc(1,2);
select dfunc('a'::text, 'b'); -- positional notation with default
-select dfunc(1 as a, 2 as b);
-select dfunc('a'::text as a, 'b' as b);
-select dfunc('a'::text as a, 'b' as b, false as flag); -- named notation
+select dfunc(a := 1, b := 2);
+select dfunc(a := 'a'::text, b := 'b');
+select dfunc(a := 'a'::text, b := 'b', flag := false); -- named notation
-select dfunc('b'::text as b, 'a' as a); -- named notation with default
-select dfunc('a'::text as a, true as flag); -- named notation with default
-select dfunc('a'::text as a, false as flag); -- named notation with default
-select dfunc('b'::text as b, 'a' as a, true as flag); -- named notation
+select dfunc(b := 'b'::text, a := 'a'); -- named notation with default
+select dfunc(a := 'a'::text, flag := true); -- named notation with default
+select dfunc(a := 'a'::text, flag := false); -- named notation with default
+select dfunc(b := 'b'::text, a := 'a', flag := true); -- named notation
select dfunc('a'::text, 'b', false); -- full positional notation
-select dfunc('a'::text, 'b', false as flag); -- mixed notation
+select dfunc('a'::text, 'b', flag := false); -- mixed notation
select dfunc('a'::text, 'b', true); -- full positional notation
-select dfunc('a'::text, 'b', true as flag); -- mixed notation
+select dfunc('a'::text, 'b', flag := true); -- mixed notation
-- check reverse-listing of named-arg calls
CREATE VIEW dfview AS
SELECT q1, q2,
- dfunc(q1,q2, q1>q2 as flag) as c3,
- dfunc(q1, q1<q2 as flag, q2 AS b) as c4
+ dfunc(q1,q2, flag := q1>q2) as c3,
+ dfunc(q1, flag := q1<q2, b := q2) as c4
FROM int8_tbl;
select * from dfview;