Skip to content

Commit 72c8a58

Browse files
committed
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.
1 parent 2268d1c commit 72c8a58

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/backend/catalog/pg_proc.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,12 @@ ProcedureCreate(const char *procedureName,
283283
}
284284
}
285285

286+
/* Guard against a case the planner doesn't handle yet */
287+
if (isWindowFunc && parameterDefaults != NIL)
288+
ereport(ERROR,
289+
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
290+
errmsg("window functions cannot have default arguments")));
291+
286292
/*
287293
* All seems OK; prepare the data to be inserted into pg_proc.
288294
*/

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy