Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite044a44

Browse files
committed
Deparse named arguments to use the new => operator instead of :=
Tom Lane pointed out that this wasn't done, and asked whether that wasintentional. Subsequent discussion was in favor of making the change,so here we go.
1 parente7cb7ee commite044a44

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

‎src/backend/parser/parse_func.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1860,7 +1860,7 @@ funcname_signature_string(const char *funcname, int nargs,
18601860
appendStringInfoString(&argbuf,", ");
18611861
if (i >=numposargs)
18621862
{
1863-
appendStringInfo(&argbuf,"%s:= ", (char*)lfirst(lc));
1863+
appendStringInfo(&argbuf,"%s=> ", (char*)lfirst(lc));
18641864
lc=lnext(lc);
18651865
}
18661866
appendStringInfoString(&argbuf,format_type_be(argtypes[i]));

‎src/backend/utils/adt/ruleutils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6856,7 +6856,7 @@ get_rule_expr(Node *node, deparse_context *context,
68566856
{
68576857
NamedArgExpr*na= (NamedArgExpr*)node;
68586858

6859-
appendStringInfo(buf,"%s:= ",quote_identifier(na->name));
6859+
appendStringInfo(buf,"%s=> ",quote_identifier(na->name));
68606860
get_rule_expr((Node*)na->arg,context,showimplicit);
68616861
}
68626862
break;

‎src/test/regress/expected/polymorphism.out

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,17 +1124,17 @@ ERROR: positional argument cannot follow named argument
11241124
LINE 1: select * from dfunc(10, b := 20, 30);
11251125
^
11261126
select * from dfunc(x := 10, b := 20, c := 30); -- fail, unknown param
1127-
ERROR: function dfunc(x:= integer, b:= integer, c:= integer) does not exist
1127+
ERROR: function dfunc(x=> integer, b=> integer, c=> integer) does not exist
11281128
LINE 1: select * from dfunc(x := 10, b := 20, c := 30);
11291129
^
11301130
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
11311131
select * from dfunc(10, 10, a := 20); -- fail, a overlaps positional parameter
1132-
ERROR: function dfunc(integer, integer, a:= integer) does not exist
1132+
ERROR: function dfunc(integer, integer, a=> integer) does not exist
11331133
LINE 1: select * from dfunc(10, 10, a := 20);
11341134
^
11351135
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
11361136
select * from dfunc(1,c := 2,d := 3); -- fail, no value for b
1137-
ERROR: function dfunc(integer, c:= integer, d:= integer) does not exist
1137+
ERROR: function dfunc(integer, c=> integer, d=> integer) does not exist
11381138
LINE 1: select * from dfunc(1,c := 2,d := 3);
11391139
^
11401140
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
@@ -1175,7 +1175,7 @@ select * from dfunc('Hello World', c := '2009-07-25'::date, b := 20);
11751175
(1 row)
11761176

11771177
select * from dfunc('Hello World', c := 20, b := '2009-07-25'::date); -- fail
1178-
ERROR: function dfunc(unknown, c:= integer, b:= date) does not exist
1178+
ERROR: function dfunc(unknown, c=> integer, b=> date) does not exist
11791179
LINE 1: select * from dfunc('Hello World', c := 20, b := '2009-07-25...
11801180
^
11811181
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
@@ -1450,8 +1450,8 @@ select * from dfview;
14501450
View definition:
14511451
SELECT int8_tbl.q1,
14521452
int8_tbl.q2,
1453-
dfunc(int8_tbl.q1, int8_tbl.q2, flag:= int8_tbl.q1 > int8_tbl.q2) AS c3,
1454-
dfunc(int8_tbl.q1, flag:= int8_tbl.q1 < int8_tbl.q2, b:= int8_tbl.q2) AS c4
1453+
dfunc(int8_tbl.q1, int8_tbl.q2, flag=> int8_tbl.q1 > int8_tbl.q2) AS c3,
1454+
dfunc(int8_tbl.q1, flag=> int8_tbl.q1 < int8_tbl.q2, b=> int8_tbl.q2) AS c4
14551455
FROM int8_tbl;
14561456

14571457
drop view dfview;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp