Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

postgresql permission denied to view table

By
gpkarthick
on 8/8/13, 7:31 AM 2,870 views

I have 2 user

postgresql users are 1) openerp--->databases are demo 2) arun -----> databases are sample, arun, live

arun@arun-Disktop--iam working using terminal like cd /optopenerp/server --->./openerp-server

i can view sample arun and live in localhost:8069 i can not view demo database and also postgres arun role database i can not view the tables so i try to change the postgres user as openerp how to do that can any one help me!!!!! Advance thanks

0

Marc Cassuto

--Marc Cassuto--
815
| 4 4 8
Montreal, Canada
--Marc Cassuto--


Marc Cassuto
On 8/8/13, 3:02 PM

Hello,

your openERP server has 2 parameters --db_password= and --db_user= to match the correct database user.

If you want two different db-users you must either pass different parameters to your server or run 2 different openERP instances.

At the opposite, if you want to see all the database within the same server, you have to grant access to all the DB to the same user.

You can do this with the following pgsql commands :

  • ALTER DATABASE my_db OWNER TO my_user;
  • GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO my_user;
  • GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO my_user;

I you still have read errors, pass the following bash commands :

for tbl in psql -qAt -c "select tablename from pg_tables where schemaname = 'public';" my_db ; do psql -c "alter table $tbl owner to my_user" my_db ; done

for tbl in psql -qAt -c "select sequence_name from information_schema.sequences where sequence_schema = 'public';" my_db ; do psql -c "alter table $tbl owner to my_user" my_db ; done

for tbl in psql -qAt -c "select table_name from information_schema.views where table_schema = 'public';" my_db ; do psql -c "alter table $tbl owner to my_user" my_db ; done

Hint : the complete list of server parameters are well documented. Just type

openerp-server --help

Marc.

PS: Please vote if you find this answer useful

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 8/8/13, 7:31 AM
Seen: 2870 times
Last updated: 3/16/15, 8:10 AM