mirror of
https://github.com/postgres/postgres.git
synced 2025-10-28 11:55:03 +03:00
Remove the obsolete WITH clause of CREATE FUNCTION.
This clause was superseded by SQL-standard syntax back in 7.3. We've kept it around for backwards-compatibility purposes ever since; but 15 years seems like long enough for that, especially seeing that there are undocumented weirdnesses in how it interacts with the SQL-standard syntax for specifying the same options. Michael Paquier, per an observation by Daniel Gustafsson; some small cosmetic adjustments to nearby code by me. Discussion: https://postgr.es/m/20180115022748.GB1724@paquier.xyz
This commit is contained in:
@@ -7506,51 +7506,51 @@ opt_nulls_order: NULLS_LA FIRST_P { $$ = SORTBY_NULLS_FIRST; }
|
||||
|
||||
CreateFunctionStmt:
|
||||
CREATE opt_or_replace FUNCTION func_name func_args_with_defaults
|
||||
RETURNS func_return createfunc_opt_list opt_definition
|
||||
RETURNS func_return createfunc_opt_list
|
||||
{
|
||||
CreateFunctionStmt *n = makeNode(CreateFunctionStmt);
|
||||
n->is_procedure = false;
|
||||
n->replace = $2;
|
||||
n->funcname = $4;
|
||||
n->parameters = $5;
|
||||
n->returnType = $7;
|
||||
n->options = $8;
|
||||
n->withClause = $9;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
| CREATE opt_or_replace FUNCTION func_name func_args_with_defaults
|
||||
RETURNS TABLE '(' table_func_column_list ')' createfunc_opt_list opt_definition
|
||||
RETURNS TABLE '(' table_func_column_list ')' createfunc_opt_list
|
||||
{
|
||||
CreateFunctionStmt *n = makeNode(CreateFunctionStmt);
|
||||
n->is_procedure = false;
|
||||
n->replace = $2;
|
||||
n->funcname = $4;
|
||||
n->parameters = mergeTableFuncParameters($5, $9);
|
||||
n->returnType = TableFuncTypeName($9);
|
||||
n->returnType->location = @7;
|
||||
n->options = $11;
|
||||
n->withClause = $12;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
| CREATE opt_or_replace FUNCTION func_name func_args_with_defaults
|
||||
createfunc_opt_list opt_definition
|
||||
createfunc_opt_list
|
||||
{
|
||||
CreateFunctionStmt *n = makeNode(CreateFunctionStmt);
|
||||
n->is_procedure = false;
|
||||
n->replace = $2;
|
||||
n->funcname = $4;
|
||||
n->parameters = $5;
|
||||
n->returnType = NULL;
|
||||
n->options = $6;
|
||||
n->withClause = $7;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
| CREATE opt_or_replace PROCEDURE func_name func_args_with_defaults
|
||||
createfunc_opt_list
|
||||
{
|
||||
CreateFunctionStmt *n = makeNode(CreateFunctionStmt);
|
||||
n->is_procedure = true;
|
||||
n->replace = $2;
|
||||
n->funcname = $4;
|
||||
n->parameters = $5;
|
||||
n->returnType = NULL;
|
||||
n->is_procedure = true;
|
||||
n->options = $6;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user