"David G. Johnston" <david.g.johnston@gmail.com> writes: > Right, because the oid is preserved when the create or replace finishes > pg_depend must have an entry where objid = refobjid where the oid value is > that of the originally created function that is now just being altered. > That situation seems detectable and prohibit-able.
This would not fix the problem for the case of two or more mutually recursive functions (that is, a() calls b() calls a()). So I don't find it to be an attractive answer.
Tack on a modified implementation of the existing detection of circular dependencies among roles to detect circular dependencies among sql_body functions?
While I agree making it must work would be nice given the presence of simple alternatives to use when this functionality is required it's got to be easier to detect and prohibit creation.