freeside/bin pg-readonly,1.1,1.2

ivan ivan at pouncequick.420.am
Fri Feb 25 14:14:44 PST 2005


Update of /home/cvs/cvsroot/freeside/bin
In directory pouncequick:/tmp/cvs-serv30285

Modified Files:
	pg-readonly 
Log Message:
try to set the sequences right for modern Pg

Index: pg-readonly
===================================================================
RCS file: /home/cvs/cvsroot/freeside/bin/pg-readonly,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- pg-readonly	25 Feb 2005 22:07:57 -0000	1.1
+++ pg-readonly	25 Feb 2005 22:14:41 -0000	1.2
@@ -17,6 +17,8 @@
 foreach my $table ( dbdef->tables ) {
   $dbh->do("GRANT SELECT ON $table TO $rouser");
   $dbh->commit();
-  $dbh->do("GRANT SELECT ON ${table}_seq TO $rouser");
-  $dbh->commit();
+  if ( my $pkey = dbdef->table($table)->primary_key ) {
+    $dbh->do("GRANT SELECT ON ${table}_${pkey}_seq TO $rouser");
+    $dbh->commit();
+  }
 }




More information about the freeside-commits mailing list