From 5d2eb9bf6bc24562ed6cff037379e78a2da7a654 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 2 Apr 2005 20:34:23 +0000 Subject: [PATCH] adding quick slony setup script --- bin/slony-setup | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100755 bin/slony-setup diff --git a/bin/slony-setup b/bin/slony-setup new file mode 100755 index 000000000..0c6c1cf20 --- /dev/null +++ b/bin/slony-setup @@ -0,0 +1,53 @@ +#!/usr/bin/perl +# +# hack to update/add read-only permissions for a user on the db +# +# usage: pg-readonly freesideuser readonlyuser + +use strict; +use DBI; +use FS::UID qw(adminsuidsetup); +use FS::Record qw(dbdef); + +my $user = shift or die &usage; +adminsuidsetup($user); + +#--- + +#su postgres -c 'createlang plpgsql freeside' + +#--- + +my $MASTERHOST = '172.21.0.204'; +my $SLAVEHOST = '172.21.0.205'; +#my $REPLICATIONUSER='pgsql'; +my $REPLICATIONUSER='postgres'; + +#drop set ( id = 1, origin = 1); + +print <tables ) { + #next if $table =~ /^sql_/i; + print "set add table (set id=1, origin=1, id=". $id++. ", fully qualified name = 'public.$table' );\n"; + +} + +print <