X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=doc%2FMAINTENANCE;h=df5cae54b42d7825660f804f71a9086aa6c11b2d;hb=238254c1b04d15d5fb641311f80324433e9908c1;hp=907411a15a63118102d4cead85c5f921c72407d8;hpb=c6a2204d8d75293256fd17c07e54971d7672359a;p=mir.git diff --git a/doc/MAINTENANCE b/doc/MAINTENANCE index 907411a1..df5cae54 100755 --- a/doc/MAINTENANCE +++ b/doc/MAINTENANCE @@ -15,3 +15,25 @@ be "cleaned". See postgresql docs for commands VACUUM and VACUUM ANALYZE We also have misc. perl scripts to merge Large Objects from other DB's. these can be used as a basis to write your own custom scripts. + +USER MANAGMENT IN POSTGRESQL + +-- set owner of datbase +select * from pg_database; +select * from pg_user; +update pg_database set datdba=ID_FROM_PG_USER where datname=DATABASENAME + +-- find all tables to grant privs / select is just building sql +-- to be exectued + +select 'grant all on '||relname||' to "de_indy";' +from pg_class +where relname not like 'pg%' +order by relname; + +-- alter table owner / select is just building sql +-- to be exectued +select 'alter table '||relname||' owner to "de_indy";' +from pg_class +where relname not like 'pg%' +order by relname; \ No newline at end of file