#!/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 <