]> granicus.if.org Git - postgresql/commitdiff
ProcedureCreate neglected to record dependencies on default expressions.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 3 Oct 2011 16:13:15 +0000 (12:13 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 3 Oct 2011 16:13:40 +0000 (12:13 -0400)
Thus, an object referenced in a default expression could be dropped while
the function remained present.  This was unaccountably missed in the
original patch to add default parameters for functions.  Reported by
Pavel Stehule.

src/backend/catalog/pg_proc.c

index 18a2c1a3c081c69ad638b691ad09f2274382770b..72559daf54975eb8e706aaf0f8ee5de9fa4b318f 100644 (file)
@@ -598,6 +598,11 @@ ProcedureCreate(const char *procedureName,
                recordDependencyOn(&myself, &referenced, DEPENDENCY_NORMAL);
        }
 
+       /* dependency on parameter default expressions */
+       if (parameterDefaults)
+               recordDependencyOnExpr(&myself, (Node *) parameterDefaults,
+                                                          NIL, DEPENDENCY_NORMAL);
+
        /* dependency on owner */
        if (!is_update)
                recordDependencyOnOwner(ProcedureRelationId, retval, proowner);