OSDN Git Service

Fix erroneous handling of shared dependencies (ie dependencies on roles)
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 2 Oct 2009 18:13:04 +0000 (18:13 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 2 Oct 2009 18:13:04 +0000 (18:13 +0000)
commitd691cb91415542e398aa6ad015ea6a5eab53ab0d
tree28e9060aee9499517661b2c0e69f4ac5fe3e52d3
parentcaa4cfa3697472a6673eb817eb34681684cba14f
Fix erroneous handling of shared dependencies (ie dependencies on roles)
in CREATE OR REPLACE FUNCTION.  The original code would update pg_shdepend
as if a new function was being created, even if it wasn't, with two bad
consequences: pg_shdepend might record the wrong owner for the function,
and any dependencies for roles mentioned in the function's ACL would be lost.
The fix is very easy: just don't touch pg_shdepend at all when doing a
function replacement.

Also update the CREATE FUNCTION reference page, which never explained
exactly what changes and doesn't change in a function replacement.
In passing, fix the CREATE VIEW reference page similarly; there's no
code bug there, but the docs didn't say what happens.
doc/src/sgml/ref/create_function.sgml
doc/src/sgml/ref/create_view.sgml
src/backend/catalog/pg_proc.c