Odoo Help

2

1
1 Answer
2
Papirkriger.no Norway
9/27/17, 7:20 AM

You're not specifying which OS your odoo-server (or dedicated postgresql-server) runs on, so I'm gonna assume it's Ubuntu Linux or equivalent.

1. SSH inn to your server.

2. Change user to your database-user (name of database-user was set during initial setup of system):
sudo su postgres

3. Start Psql:
psql

4. List available databases:
\l

5. Drop database:
drop database your_db_name_to_remove;

5.1. If you get a message something like "Unable to drop database. DETAIL: There are 5 other sessions using the database postgres", you need remove the active connections by typing:
SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname = 'your_db_name_to_remove' AND pid != pg_backend_pid();

5.2 IF on postgres 8.4-9.1, run the following instead:
SELECT pg_terminate_backend(procpid) FROM pg_stat_activity WHERE procpid <> pg_backend_pid() AND datname = 'your_db_name_to_remove';

6. Repeat for all test-databases.

7. Exit psql
\q

8. Exit databaseuser-userspace:
exit

9. Restart odoo-server, e.g;
sudo service odoo-server restart

10. Exit ssh
exit

1 Comment
Xavier Brochard France
10/31/17, 9:30 AM

Don't forget ";" at the end of lines in psql command. It's also better to enclose db_name in double quotes (because of uppercase, special characters, etc.)

Ask a Question
Keep Informed
1 follower(s)
About This Community

This platform 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.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now