Make bdr.queue_truncate() SECURITY DEFINER
authorCraig Ringer <craig@2ndquadrant.com>
Tue, 24 Mar 2015 06:39:30 +0000 (14:39 +0800)
committerCraig Ringer <craig@2ndquadrant.com>
Tue, 24 Mar 2015 06:39:30 +0000 (14:39 +0800)
Fixes #5.

This shows our testing doesn't cover DDL as non-superuser properly.

doc/manual-global-sequences.sgml
extsql/bdr--0.9.0.2--0.9.0.3.sql

index c999f2f48ca9c6b5dab29cf8af07de37b3cb7131..4bd2ea7aaa7e4575027a747f8e9f36b7e00deaae 100644 (file)
@@ -39,7 +39,8 @@
    202, 302, ...; etc. This is easily done with PostgreSQL's existing sequences,
    but becomes a major problem if you don't allow enough room for growth - in
    the above, if you have 101 nodes you're in serious trouble. It's also
-   awkward, requiring node-specific DDL and setup.
+   awkward, requiring node-specific DDL and setup. See <xref
+   linkend="global-sequences-alternatives">.
   </para>
 
   <para>
index 0a1578512e8e5c412bcf86346de0203855a4c82c..348b5870f11f95812aaf4e0647d78c859cb0e8e2 100644 (file)
@@ -54,6 +54,11 @@ $$;
 COMMENT ON FUNCTION bdr.bdr_get_local_node_name()
 IS 'Return the name from bdr.bdr_nodes for the local node, or null if no entry exists';
 
+-- See https://github.com/2ndQuadrant/bdr/issues/5
+ALTER FUNCTION bdr.queue_truncate()
+SECURITY DEFINER
+SET search_path = 'bdr';
+
 RESET bdr.permit_unsafe_ddl_commands;
 RESET bdr.skip_ddl_replication;
 RESET search_path;