Skip to content

Commit aefeb68

Browse files
committed
Allow referring to functions without arguments when unique
In DDL commands referring to an existing function, allow omitting the argument list if the function name is unique in its schema, per SQL standard. This uses the same logic that the regproc type uses for finding functions by name only. Reviewed-by: Michael Paquier <michael.paquier@gmail.com>
1 parent 3f6ea5f commit aefeb68

17 files changed

+143
-28
lines changed

doc/src/sgml/ref/alter_extension.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ ALTER EXTENSION <replaceable class="PARAMETER">name</replaceable> DROP <replacea
3939
EVENT TRIGGER <replaceable class="PARAMETER">object_name</replaceable> |
4040
FOREIGN DATA WRAPPER <replaceable class="PARAMETER">object_name</replaceable> |
4141
FOREIGN TABLE <replaceable class="PARAMETER">object_name</replaceable> |
42-
FUNCTION <replaceable class="PARAMETER">function_name</replaceable> ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] ) |
42+
FUNCTION <replaceable class="PARAMETER">function_name</replaceable> [ ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] ) ] |
4343
MATERIALIZED VIEW <replaceable class="PARAMETER">object_name</replaceable> |
4444
OPERATOR <replaceable class="PARAMETER">operator_name</replaceable> (<replaceable class="PARAMETER">left_type</replaceable>, <replaceable class="PARAMETER">right_type</replaceable>) |
4545
OPERATOR CLASS <replaceable class="PARAMETER">object_name</replaceable> USING <replaceable class="parameter">index_method</replaceable> |

doc/src/sgml/ref/alter_function.sgml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ PostgreSQL documentation
2121

2222
<refsynopsisdiv>
2323
<synopsis>
24-
ALTER FUNCTION <replaceable>name</replaceable> ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] )
24+
ALTER FUNCTION <replaceable>name</replaceable> [ ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] ) ]
2525
<replaceable class="PARAMETER">action</replaceable> [ ... ] [ RESTRICT ]
26-
ALTER FUNCTION <replaceable>name</replaceable> ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] )
26+
ALTER FUNCTION <replaceable>name</replaceable> [ ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] ) ]
2727
RENAME TO <replaceable>new_name</replaceable>
28-
ALTER FUNCTION <replaceable>name</replaceable> ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] )
28+
ALTER FUNCTION <replaceable>name</replaceable> [ ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] ) ]
2929
OWNER TO { <replaceable>new_owner</replaceable> | CURRENT_USER | SESSION_USER }
30-
ALTER FUNCTION <replaceable>name</replaceable> ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] )
30+
ALTER FUNCTION <replaceable>name</replaceable> [ ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] ) ]
3131
SET SCHEMA <replaceable>new_schema</replaceable>
32-
ALTER FUNCTION <replaceable>name</replaceable> ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] )
32+
ALTER FUNCTION <replaceable>name</replaceable> [ ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] ) ]
3333
DEPENDS ON EXTENSION <replaceable>extension_name</replaceable>
3434

3535
<phrase>where <replaceable class="PARAMETER">action</replaceable> is one of:</phrase>
@@ -75,7 +75,8 @@ ALTER FUNCTION <replaceable>name</replaceable> ( [ [ <replaceable class="paramet
7575
<term><replaceable class="parameter">name</replaceable></term>
7676
<listitem>
7777
<para>
78-
The name (optionally schema-qualified) of an existing function.
78+
The name (optionally schema-qualified) of an existing function. If no
79+
argument list is specified, the name must be unique in its schema.
7980
</para>
8081
</listitem>
8182
</varlistentry>

doc/src/sgml/ref/alter_opfamily.sgml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ALTER OPERATOR FAMILY <replaceable>name</replaceable> USING <replaceable class="
2525
{ OPERATOR <replaceable class="parameter">strategy_number</replaceable> <replaceable class="parameter">operator_name</replaceable> ( <replaceable class="parameter">op_type</replaceable>, <replaceable class="parameter">op_type</replaceable> )
2626
[ FOR SEARCH | FOR ORDER BY <replaceable class="parameter">sort_family_name</replaceable> ]
2727
| FUNCTION <replaceable class="parameter">support_number</replaceable> [ ( <replaceable class="parameter">op_type</replaceable> [ , <replaceable class="parameter">op_type</replaceable> ] ) ]
28-
<replaceable class="parameter">function_name</replaceable> ( <replaceable class="parameter">argument_type</replaceable> [, ...] )
28+
<replaceable class="parameter">function_name</replaceable> [ ( <replaceable class="parameter">argument_type</replaceable> [, ...] ) ]
2929
} [, ... ]
3030

3131
ALTER OPERATOR FAMILY <replaceable>name</replaceable> USING <replaceable class="parameter">index_method</replaceable> DROP
@@ -195,8 +195,9 @@ ALTER OPERATOR FAMILY <replaceable>name</replaceable> USING <replaceable class="
195195
<term><replaceable class="parameter">function_name</replaceable></term>
196196
<listitem>
197197
<para>
198-
The name (optionally schema-qualified) of a function that is an
199-
index method support procedure for the operator family.
198+
The name (optionally schema-qualified) of a function that is an index
199+
method support procedure for the operator family. If no argument list
200+
is specified, the name must be unique in its schema.
200201
</para>
201202
</listitem>
202203
</varlistentry>

doc/src/sgml/ref/comment.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ COMMENT ON
3737
EVENT TRIGGER <replaceable class="PARAMETER">object_name</replaceable> |
3838
FOREIGN DATA WRAPPER <replaceable class="PARAMETER">object_name</replaceable> |
3939
FOREIGN TABLE <replaceable class="PARAMETER">object_name</replaceable> |
40-
FUNCTION <replaceable class="PARAMETER">function_name</replaceable> ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] ) |
40+
FUNCTION <replaceable class="PARAMETER">function_name</replaceable> [ ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] ) ] |
4141
INDEX <replaceable class="PARAMETER">object_name</replaceable> |
4242
LARGE OBJECT <replaceable class="PARAMETER">large_object_oid</replaceable> |
4343
MATERIALIZED VIEW <replaceable class="PARAMETER">object_name</replaceable> |

doc/src/sgml/ref/create_cast.sgml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<refsynopsisdiv>
2020
<synopsis>
2121
CREATE CAST (<replaceable>source_type</replaceable> AS <replaceable>target_type</replaceable>)
22-
WITH FUNCTION <replaceable>function_name</replaceable> (<replaceable>argument_type</replaceable> [, ...])
22+
WITH FUNCTION <replaceable>function_name</replaceable> [ (<replaceable>argument_type</replaceable> [, ...]) ]
2323
[ AS ASSIGNMENT | AS IMPLICIT ]
2424

2525
CREATE CAST (<replaceable>source_type</replaceable> AS <replaceable>target_type</replaceable>)
@@ -192,14 +192,16 @@ SELECT CAST ( 2 AS numeric ) + 4.0;
192192
</varlistentry>
193193

194194
<varlistentry>
195-
<term><replaceable>function_name</replaceable>(<replaceable>argument_type</replaceable> [, ...])</term>
195+
<term><literal><replaceable>function_name</replaceable>[(<replaceable>argument_type</replaceable> [, ...])]</literal></term>
196196

197197
<listitem>
198198
<para>
199199
The function used to perform the cast. The function name can
200200
be schema-qualified. If it is not, the function will be looked
201201
up in the schema search path. The function's result data type must
202202
match the target type of the cast. Its arguments are discussed below.
203+
If no argument list is specified, the function name must be unique in
204+
its schema.
203205
</para>
204206
</listitem>
205207
</varlistentry>

doc/src/sgml/ref/create_transform.sgml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
<refsynopsisdiv>
2020
<synopsis>
2121
CREATE [ OR REPLACE ] TRANSFORM FOR <replaceable>type_name</replaceable> LANGUAGE <replaceable>lang_name</replaceable> (
22-
FROM SQL WITH FUNCTION <replaceable>from_sql_function_name</replaceable> (<replaceable>argument_type</replaceable> [, ...]),
23-
TO SQL WITH FUNCTION <replaceable>to_sql_function_name</replaceable> (<replaceable>argument_type</replaceable> [, ...])
22+
FROM SQL WITH FUNCTION <replaceable>from_sql_function_name</replaceable> [ (<replaceable>argument_type</replaceable> [, ...]) ],
23+
TO SQL WITH FUNCTION <replaceable>to_sql_function_name</replaceable> [ (<replaceable>argument_type</replaceable> [, ...]) ]
2424
);
2525
</synopsis>
2626
</refsynopsisdiv>
@@ -104,7 +104,7 @@ CREATE [ OR REPLACE ] TRANSFORM FOR <replaceable>type_name</replaceable> LANGUAG
104104
</varlistentry>
105105

106106
<varlistentry>
107-
<term><replaceable>from_sql_function_name</replaceable>(<replaceable>argument_type</replaceable> [, ...])</term>
107+
<term><literal><replaceable>from_sql_function_name</replaceable>[(<replaceable>argument_type</replaceable> [, ...])]</literal></term>
108108

109109
<listitem>
110110
<para>
@@ -116,12 +116,14 @@ CREATE [ OR REPLACE ] TRANSFORM FOR <replaceable>type_name</replaceable> LANGUAG
116116
SQL-level function returning <type>internal</type> without at
117117
least one argument of type <type>internal</type>.) The actual return
118118
value will be something specific to the language implementation.
119+
If no argument list is specified, the function name must be unique in
120+
its schema.
119121
</para>
120122
</listitem>
121123
</varlistentry>
122124

123125
<varlistentry>
124-
<term><replaceable>to_sql_function_name</replaceable>(<replaceable>argument_type</replaceable> [, ...])</term>
126+
<term><literal><replaceable>to_sql_function_name</replaceable>[(<replaceable>argument_type</replaceable> [, ...])]</literal></term>
125127

126128
<listitem>
127129
<para>
@@ -130,6 +132,8 @@ CREATE [ OR REPLACE ] TRANSFORM FOR <replaceable>type_name</replaceable> LANGUAG
130132
<type>internal</type> and return the type that is the type for the
131133
transform. The actual argument value will be something specific to the
132134
language implementation.
135+
If no argument list is specified, the function name must be unique in
136+
its schema.
133137
</para>
134138
</listitem>
135139
</varlistentry>

doc/src/sgml/ref/drop_function.sgml

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ PostgreSQL documentation
2121

2222
<refsynopsisdiv>
2323
<synopsis>
24-
DROP FUNCTION [ IF EXISTS ] <replaceable class="parameter">name</replaceable> ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] ) [, ...]
24+
DROP FUNCTION [ IF EXISTS ] <replaceable class="parameter">name</replaceable> [ ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] ) ] [, ...]
2525
[ CASCADE | RESTRICT ]
2626
</synopsis>
2727
</refsynopsisdiv>
@@ -56,7 +56,8 @@ DROP FUNCTION [ IF EXISTS ] <replaceable class="parameter">name</replaceable> (
5656
<term><replaceable class="parameter">name</replaceable></term>
5757
<listitem>
5858
<para>
59-
The name (optionally schema-qualified) of an existing function.
59+
The name (optionally schema-qualified) of an existing function. If no
60+
argument list is specified, the name must be unique in its schema.
6061
</para>
6162
</listitem>
6263
</varlistentry>
@@ -141,14 +142,40 @@ DROP FUNCTION sqrt(integer);
141142
<programlisting>
142143
DROP FUNCTION sqrt(integer), sqrt(bigint);
143144
</programlisting></para>
145+
146+
<para>
147+
If the function name is unique in its schema, it can be referred to without
148+
an argument list:
149+
<programlisting>
150+
DROP FUNCTION update_employee_salaries;
151+
</programlisting>
152+
Note that this is different from
153+
<programlisting>
154+
DROP FUNCTION update_employee_salaries();
155+
</programlisting>
156+
which refers to a function with zero arguments, whereas the first variant
157+
can refer to a function with any number of arguments, including zero, as
158+
long as the name is unique.
159+
</para>
144160
</refsect1>
145161

146162
<refsect1 id="SQL-DROPFUNCTION-compatibility">
147163
<title>Compatibility</title>
148164

149165
<para>
150-
A <command>DROP FUNCTION</command> statement is defined in the SQL
151-
standard, but it is not compatible with this command.
166+
This command conforms to the SQL standard, with
167+
these <productname>PostgreSQL</productname> extensions:
168+
<itemizedlist>
169+
<listitem>
170+
<para>The standard only allows one function to be dropped per command.</para>
171+
</listitem>
172+
<listitem>
173+
<para>The <literal>IF EXISTS</literal> option</para>
174+
</listitem>
175+
<listitem>
176+
<para>The ability to specify argument modes and names</para>
177+
</listitem>
178+
</itemizedlist>
152179
</para>
153180
</refsect1>
154181

doc/src/sgml/ref/grant.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ GRANT { USAGE | ALL [ PRIVILEGES ] }
5555
TO <replaceable class="PARAMETER">role_specification</replaceable> [, ...] [ WITH GRANT OPTION ]
5656

5757
GRANT { EXECUTE | ALL [ PRIVILEGES ] }
58-
ON { FUNCTION <replaceable>function_name</replaceable> ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">arg_name</replaceable> ] <replaceable class="parameter">arg_type</replaceable> [, ...] ] ) [, ...]
58+
ON { FUNCTION <replaceable>function_name</replaceable> [ ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">arg_name</replaceable> ] <replaceable class="parameter">arg_type</replaceable> [, ...] ] ) ] [, ...]
5959
| ALL FUNCTIONS IN SCHEMA <replaceable class="PARAMETER">schema_name</replaceable> [, ...] }
6060
TO <replaceable class="PARAMETER">role_specification</replaceable> [, ...] [ WITH GRANT OPTION ]
6161

doc/src/sgml/ref/revoke.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ REVOKE [ GRANT OPTION FOR ]
7070

7171
REVOKE [ GRANT OPTION FOR ]
7272
{ EXECUTE | ALL [ PRIVILEGES ] }
73-
ON { FUNCTION <replaceable>function_name</replaceable> ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">arg_name</replaceable> ] <replaceable class="parameter">arg_type</replaceable> [, ...] ] ) [, ...]
73+
ON { FUNCTION <replaceable>function_name</replaceable> [ ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">arg_name</replaceable> ] <replaceable class="parameter">arg_type</replaceable> [, ...] ] ) ] [, ...]
7474
| ALL FUNCTIONS IN SCHEMA <replaceable>schema_name</replaceable> [, ...] }
7575
FROM { [ GROUP ] <replaceable class="PARAMETER">role_name</replaceable> | PUBLIC } [, ...]
7676
[ CASCADE | RESTRICT ]

doc/src/sgml/ref/security_label.sgml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ SECURITY LABEL [ FOR <replaceable class="PARAMETER">provider</replaceable> ] ON
3030
DOMAIN <replaceable class="PARAMETER">object_name</replaceable> |
3131
EVENT TRIGGER <replaceable class="PARAMETER">object_name</replaceable> |
3232
FOREIGN TABLE <replaceable class="PARAMETER">object_name</replaceable>
33-
FUNCTION <replaceable class="PARAMETER">function_name</replaceable> ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] ) |
33+
FUNCTION <replaceable class="PARAMETER">function_name</replaceable> [ ( [ [ <replaceable class="parameter">argmode</replaceable> ] [ <replaceable class="parameter">argname</replaceable> ] <replaceable class="parameter">argtype</replaceable> [, ...] ] ) ] |
3434
LARGE OBJECT <replaceable class="PARAMETER">large_object_oid</replaceable> |
3535
MATERIALIZED VIEW <replaceable class="PARAMETER">object_name</replaceable> |
3636
[ PROCEDURAL ] LANGUAGE <replaceable class="PARAMETER">object_name</replaceable> |

src/backend/nodes/copyfuncs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3067,6 +3067,7 @@ _copyObjectWithArgs(const ObjectWithArgs *from)
30673067

30683068
COPY_NODE_FIELD(objname);
30693069
COPY_NODE_FIELD(objargs);
3070+
COPY_SCALAR_FIELD(args_unspecified);
30703071

30713072
return newnode;
30723073
}

src/backend/nodes/equalfuncs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,7 @@ _equalObjectWithArgs(const ObjectWithArgs *a, const ObjectWithArgs *b)
11191119
{
11201120
COMPARE_NODE_FIELD(objname);
11211121
COMPARE_NODE_FIELD(objargs);
1122+
COMPARE_SCALAR_FIELD(args_unspecified);
11221123

11231124
return true;
11241125
}

src/backend/parser/gram.y

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7202,6 +7202,33 @@ function_with_argtypes:
72027202
n->objargs = extractArgTypes($2);
72037203
$$ = n;
72047204
}
7205+
/*
7206+
* Because of reduce/reduce conflicts, we can't use func_name
7207+
* below, but we can write it out the long way, which actually
7208+
* allows more cases.
7209+
*/
7210+
| type_func_name_keyword
7211+
{
7212+
ObjectWithArgs *n = makeNode(ObjectWithArgs);
7213+
n->objname = list_make1(makeString(pstrdup($1)));
7214+
n->args_unspecified = true;
7215+
$$ = n;
7216+
}
7217+
| ColId
7218+
{
7219+
ObjectWithArgs *n = makeNode(ObjectWithArgs);
7220+
n->objname = list_make1(makeString($1));
7221+
n->args_unspecified = true;
7222+
$$ = n;
7223+
}
7224+
| ColId indirection
7225+
{
7226+
ObjectWithArgs *n = makeNode(ObjectWithArgs);
7227+
n->objname = check_func_name(lcons(makeString($1), $2),
7228+
yyscanner);
7229+
n->args_unspecified = true;
7230+
$$ = n;
7231+
}
72057232
;
72067233

72077234
/*

src/backend/parser/parse_func.c

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,8 +1895,10 @@ func_signature_string(List *funcname, int nargs,
18951895

18961896
/*
18971897
* LookupFuncName
1898-
* Given a possibly-qualified function name and a set of argument types,
1899-
* look up the function.
1898+
*
1899+
* Given a possibly-qualified function name and optionally a set of argument
1900+
* types, look up the function. Pass nargs == -1 to indicate that no argument
1901+
* types are specified.
19001902
*
19011903
* If the function name is not schema-qualified, it is sought in the current
19021904
* namespace search path.
@@ -1914,6 +1916,35 @@ LookupFuncName(List *funcname, int nargs, const Oid *argtypes, bool noError)
19141916

19151917
clist = FuncnameGetCandidates(funcname, nargs, NIL, false, false, noError);
19161918

1919+
/*
1920+
* If no arguments were specified, the name must yield a unique candidate.
1921+
*/
1922+
if (nargs == -1)
1923+
{
1924+
if (clist)
1925+
{
1926+
if (clist->next)
1927+
{
1928+
if (!noError)
1929+
ereport(ERROR,
1930+
(errcode(ERRCODE_AMBIGUOUS_FUNCTION),
1931+
errmsg("function name \"%s\" is not unique",
1932+
NameListToString(funcname)),
1933+
errhint("Specify the argument list to select the function unambiguously.")));
1934+
}
1935+
else
1936+
return clist->oid;
1937+
}
1938+
else
1939+
{
1940+
if (!noError)
1941+
ereport(ERROR,
1942+
(errcode(ERRCODE_UNDEFINED_FUNCTION),
1943+
errmsg("could not find a function named \"%s\"",
1944+
NameListToString(funcname))));
1945+
}
1946+
}
1947+
19171948
while (clist)
19181949
{
19191950
if (memcmp(argtypes, clist->args, nargs * sizeof(Oid)) == 0)
@@ -1962,7 +1993,7 @@ LookupFuncWithArgs(ObjectWithArgs *func, bool noError)
19621993
args_item = lnext(args_item);
19631994
}
19641995

1965-
return LookupFuncName(func->objname, argcount, argoids, noError);
1996+
return LookupFuncName(func->objname, func->args_unspecified ? -1 : argcount, argoids, noError);
19661997
}
19671998

19681999
/*

src/include/nodes/parsenodes.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1811,6 +1811,9 @@ typedef struct ObjectWithArgs
18111811
NodeTag type;
18121812
List *objname; /* qualified name of function/operator */
18131813
List *objargs; /* list of Typename nodes */
1814+
bool args_unspecified; /* argument list was omitted, so name must
1815+
* be unique (note that objargs == NIL means
1816+
* zero args) */
18141817
} ObjectWithArgs;
18151818

18161819
/*

0 commit comments

Comments
 (0)