summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2009-10-02 18:13:10 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2009-10-02 18:13:10 +0000
commitac317a8474e7c2e2c67ee37f8cb1a6511eb662d9 (patch)
treef1af22bc7761632a89f9cd2a6309a5886b01b360 /doc/src
parentae35363dced47a99178b4a4129e3ea1f990b829c (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')
-rw-r--r--doc/src/sgml/ref/create_function.sgml10
-rw-r--r--doc/src/sgml/ref/create_view.sgml10
2 files changed, 18 insertions, 2 deletions
diff --git a/doc/src/sgml/ref/create_function.sgml b/doc/src/sgml/ref/create_function.sgml
index 0c35ded26c9..ce6141107a7 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.84.2.1 2009/09/03 22:11:13 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/create_function.sgml,v 1.84.2.2 2009/10/02 18:13:10 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">
diff --git a/doc/src/sgml/ref/create_view.sgml b/doc/src/sgml/ref/create_view.sgml
index 1a3281dda62..64c8f2102f6 100644
--- a/doc/src/sgml/ref/create_view.sgml
+++ b/doc/src/sgml/ref/create_view.sgml
@@ -1,5 +1,5 @@
<!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/create_view.sgml,v 1.41 2009/01/27 12:40:15 petere Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/create_view.sgml,v 1.41.2.1 2009/10/02 18:13:10 tgl Exp $
PostgreSQL documentation
-->
@@ -149,6 +149,14 @@ CREATE VIEW vista AS SELECT text 'Hello World' AS hello;
used by the view.
</para>
+ <para>
+ When <command>CREATE OR REPLACE VIEW</> is used on an
+ existing view, only the view's defining SELECT rule is changed.
+ Other view properties, including ownership, permissions, and non-SELECT
+ rules, remain unchanged. You must own the view
+ to replace it (this includes being a member of the owning role).
+ </para>
+
</refsect1>
<refsect1>