[Bucardo-general] Add Sync Error

Greg Sabino Mullane greg at endpoint.com
Tue Apr 17 22:06:20 UTC 2012


I think I found the problem - we were using 'tname' as both 
a local plpgsql variable and as a column name. I just pushed 
a fix in 6ba621aaeb88f301a752e8813e4af8964f346829. The diff 
to bucardo.schema is also attached to this email.

-- 
Greg Sabino Mullane greg at endpoint.com
End Point Corporation
PGP Key: 0x14964AC8
-------------- next part --------------
diff --git a/bucardo.schema b/bucardo.schema
index 2e6245d..ff9ad82 100644
--- a/bucardo.schema
+++ b/bucardo.schema
@@ -1532,26 +1532,26 @@ END;
                   SECURITY DEFINER
                   AS \$clone\$
                   DECLARE
-                    tname TEXT;
+                    tablename TEXT;
                     myst TEXT;
                   BEGIN
                     INSERT INTO bucardo.bucardo_truncate_trigger(tablename,sname,tname,sync)
                       VALUES (TG_RELID, TG_TABLE_SCHEMA, TG_TABLE_NAME, TG_ARGV[0]);
 
-                    SELECT INTO tname
+                    SELECT INTO tablename
                       bucardo.bucardo_tablename_maker(TG_TABLE_SCHEMA || '.' || TG_TABLE_NAME, 'delta_');
-                    myst = 'TRUNCATE TABLE bucardo.' || tname;
+                    myst = 'TRUNCATE TABLE bucardo.' || tablename;
                     EXECUTE myst;
 
-                    SELECT INTO tname
+                    SELECT INTO tablename
                       bucardo.bucardo_tablename_maker(TG_TABLE_SCHEMA || '.' || TG_TABLE_NAME, 'track_');
-                    myst = 'TRUNCATE TABLE bucardo.' || tname;
+                    myst = 'TRUNCATE TABLE bucardo.' || tablename;
                     EXECUTE myst;
 
                     -- Not strictly necessary, but nice to have a clean slate
-                    SELECT INTO tname
+                    SELECT INTO tablename
                       bucardo.bucardo_tablename_maker(TG_TABLE_SCHEMA || '.' || TG_TABLE_NAME, 'stage_');
-                    myst = 'TRUNCATE TABLE bucardo.' || tname;
+                    myst = 'TRUNCATE TABLE bucardo.' || tablename;
                     EXECUTE myst;
 
                     RETURN NEW;
-------------- 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/20120417/513a72fa/attachment.bin 


More information about the Bucardo-general mailing list