1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

Prevent creating window functions with default arguments.

Insertion of default arguments doesn't work for window functions, which is
likely to cause a crash at runtime if the implementation code doesn't check
the number of actual arguments carefully.  It doesn't seem worth working
harder than this for pre-9.2 branches.
This commit is contained in:
Tom Lane
2013-11-06 13:32:26 -05:00
parent db157fb141
commit aad87e3f25
2 changed files with 13 additions and 0 deletions

View File

@@ -285,6 +285,12 @@ ProcedureCreate(const char *procedureName,
}
}
/* Guard against a case the planner doesn't handle yet */
if (isWindowFunc && parameterDefaults != NIL)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("window functions cannot have default arguments")));
/*
* All seems OK; prepare the data to be inserted into pg_proc.
*/