projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5021bac
)
try to set the sequences right for modern Pg
author
ivan
<ivan>
Fri, 25 Feb 2005 22:14:41 +0000
(22:14 +0000)
committer
ivan
<ivan>
Fri, 25 Feb 2005 22:14:41 +0000
(22:14 +0000)
bin/pg-readonly
patch
|
blob
|
history
diff --git
a/bin/pg-readonly
b/bin/pg-readonly
index
4f6d7c3
..
ad69fbd
100644
(file)
--- a/
bin/pg-readonly
+++ b/
bin/pg-readonly
@@
-17,6
+17,8
@@
my $dbh = adminsuidsetup $user;
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();
+ }
}