diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-10-02 18:13:04 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-10-02 18:13:04 +0000 |
commit | d691cb91415542e398aa6ad015ea6a5eab53ab0d (patch) | |
tree | 28e9060aee9499517661b2c0e69f4ac5fe3e52d3 /doc/src/sgml/ref/create_function.sgml | |
parent | caa4cfa3697472a6673eb817eb34681684cba14f (diff) |
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.
Diffstat (limited to 'doc/src/sgml/ref/create_function.sgml')
-rw-r--r-- | doc/src/sgml/ref/create_function.sgml | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/doc/src/sgml/ref/create_function.sgml b/doc/src/sgml/ref/create_function.sgml index 5b5cda3a817..0843a175638 100644 --- a/doc/src/sgml/ref/create_function.sgml +++ b/doc/src/sgml/ref/create_function.sgml @@ -1,5 +1,5 @@ <!-- -$PostgreSQL: pgsql/doc/src/sgml/ref/create_function.sgml,v 1.86 2009/09/19 10:23:26 petere Exp $ +$PostgreSQL: pgsql/doc/src/sgml/ref/create_function.sgml,v 1.87 2009/10/02 18:13:04 tgl Exp $ --> <refentry id="SQL-CREATEFUNCTION"> @@ -562,6 +562,14 @@ CREATE FUNCTION foo(int, int default 42) ... <literal>USAGE</literal> privilege on the language. </para> + <para> + When <command>CREATE OR REPLACE FUNCTION</> is used to replace an + existing function, the ownership and permissions of the function + do not change. All other function properties are assigned the + values specified or implied in the command. You must own the function + to replace it (this includes being a member of the owning role). + </para> + </refsect1> <refsect1 id="sql-createfunction-examples"> |