[Bucardo-general] Bucardo error on TRUNCATE
Greg Sabino Mullane
greg at endpoint.com
Sat Jun 18 20:53:09 UTC 2011
On Sat, Jun 18, 2011 at 01:44:45PM -0700, Christophe Pettus wrote:
> I received the following when doing a TRUNCATE on a Bucardo pushsync replicated table:
>
> bs_prod=> truncate bucardo_test;
> ERROR: permission denied for schema bucardo
> LINE 1: INSERT INTO bucardo.bucardo_truncate_trigger(tablename,sname...
I think this is because the "triggerkick" functions used to only
do NOTIFY, but then we added an INSERT on truncate, but did not
set the function as "SECURITY DEFINER". To fix you can add the
SECURITY DEFINER phrase to the bucardo.schema file around line 1567,
right after:
$SQL = qq{
CREATE OR REPLACE FUNCTION bucardo."$func0"()
RETURNS TRIGGER
LANGUAGE plpgsql
To fix existing installs, you'll need to manually adjust them, like so:
ALTER FUNCTION bucardo.bucardo_triggerkick_syncname() SECURITY DEFINER;
--
Greg Sabino Mullane greg at endpoint.com
End Point Corporation
PGP Key: 0x14964AC8
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 163 bytes
Desc: not available
Url : https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20110618/554e5d7f/attachment.bin
More information about the Bucardo-general
mailing list