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.
}
}
+ /* 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.
*/