From: ivan Date: Sat, 2 Apr 2005 20:34:23 +0000 (+0000) Subject: adding quick slony setup script X-Git-Tag: SQL_LEDGER_2_4_4~1^2~375 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=5d2eb9bf6bc24562ed6cff037379e78a2da7a654;p=freeside.git adding quick slony setup script --- 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 <