Reputation: 769
Whenever I try to backup my database, I get following error:
Postgres subprocess ('/usr/bin/pg_dump', '--no-owner', '--username=odoo', '--file=/tmp/tmp3AYPgp/dump.sql', u'OdooSetup') error 1
Can someone help pls.
Upvotes: 4
Views: 3349
Reputation: 10189
I've just experienced this situation and in my case the problem was that there were some sequences in the database whose owner was not the expected one (it should be the same as the database owner).
I mean, my database is owned by PostgreSQL user odoo
. But in this database, there were some sequences whose owner was odoo_8
(who is another PostgreSQL user I have). I don't know the reason of why this happened, but you can fix that following the next steps:
Connect to your database through psql
:
\c your_database
Show the owner of every table and sequence of your database:
\d
Check if there are some whose owner is not the right one. If so, change them:
ALTER SEQUENCE sequence_name OWNER TO right_user;
ALTER TABLE table_name OWNER TO right_user;
This command should also work and be much faster:
REASSIGN OWNED BY right_user TO right_user;
It should modify the owner of all the databases owner by right_user
, and all the tables and all the sequences of the database you're connected to.
In summary, if the database which gives you the error is named my_database and its PostgreSQL owner is odoo
, connect to psql
with the odoo
user (or a superuser) and do this:
\c my_database
REASSIGN OWNED BY odoo TO odoo;
I hope this helps to someone.
Upvotes: 1
Reputation: 740
Give me some more details of this Error, i think at last it shows like No User odoo Found in the database like that.
First, check user odoo present in the database or not, if your system user name is odoo Other wise create a Superuser in postgres using the same name as System user and try.
Upvotes: 0
Reputation: 11
Launch the command from system shell, there you'll see the error. f.e.:
pg_dump --no-owner --username=odoo OdooSetup >/dev/null
Upvotes: 1