1

I have successfully installed openerp/postgresql in windows environment. Later I created 'mydb' database. Then I tried to install apps. Systems throws following error message.

psycopg2.OperationalError - mydb doesn't exist- Fatal error.

I verified in postgresql sever for newly crated database- mydb. Can someone help me why system pops up error message ,even though daabase is created and available ?

Complete error message

 {"message": "OpenERP Server Error", "code": 200, "data": {"debug": "Traceback (most      recent call last):\n File \"/home/odoo/src/web/saas-1/addons/web/http.py\", line 304, in dispatch\n r = method(self, **self.params)\n File \"/home/odoo/src/addons/saas-1/auth_oauth/controllers/main.py\", line 33, in wrapper\n return func(self, req, **kw)\n File \"/home/odoo/src/custom/private/loempia/controllers/embed.py\", line 65, in signin\n File \"/home/odoo/src/server/saas-1/openerp/modules/registry.py\", line 206, in get\n update_module)\n File \"/home/odoo/src/server/saas-1/openerp/modules/registry.py\", line 222, in new\n registry = Registry(db_name)\n File \"/home/odoo/src/server/saas-1/openerp/modules/registry.py\", line 78, in __init__\n cr = self.db.cursor()\n File \"/home/odoo/src/server/saas-1/openerp/sql_db.py\", line 479, in cursor\n return Cursor(self._pool, self.dbname, serialized=serialized)\n File \"/home/odoo/src/server/saas-1/openerp/sql_db.py\", line 177, in __init__\n self._cnx = pool.borrow(dsn(dbname))\n File \"/home/odoo/src/server/saas-1/openerp/sql_db.py\", line 372, in _locked\n return fun(self, *args, **kwargs)\n File \"/home/odoo/src/server/saas-1/openerp/sql_db.py\", line 435, in borrow\n result = psycopg2.connect(dsn=dsn, connection_factory=PsycoConnection)\n File \"/usr/local/lib/python2.7/dist-packages/psycopg2/__init__.py\", line 164, in connect\n conn = _connect(dsn, connection_factory=connection_factory, async=async)\nOperationalError: FATAL: database \"mydb\" does not exist\n\n", "message": "FATAL: database \"mydb\" does not exist\n", "name": "psycopg2.OperationalError", "arguments": ["FATAL: database \"mydb\" does not exist\n"]}} 

select * from pg_database ( 4th record mydb is the database created by me)

   "template1";6;"English_United States.1252";t;t;-1;1663;"{=c/openpg,openpg=CTc/openpg}";"English_United States.1252";10
   "template0";6;"English_United States.1252";t;f;-1;1663;"{=c/openpg,openpg=CTc/openpg}";"English_United States.1252";10
   "postgres";6;"English_United States.1252";f;t;-1;1663;"";"English_United States.1252";10
   "mydb";6;"English_United States.1252";f;t;-1;1663;"";"English_United States.1252";10
3
  • Please show the exact original message, copied-and-pasted. Please also show the exact, copied and pasted output of SELECT * FROM pg_database. I also suggest making sure you're really connecting to the same database in both cases. Jan 10, 2014 at 6:50
  • Sorry for the delay . I was facing issue with internet.Thanks Craig. I have provided requested information. Let me know , if you need any other info on this Jan 10, 2014 at 12:20
  • So you database is really called mydb? You haven't edited/replaced that name? It's not really named OpenERPDatabase or something? Jan 11, 2014 at 3:23

1 Answer 1

1

There are only a few possibilities here:

  • You're not connecting to the same server using OpenERP as you do with psql. The DB only exists on the server you connect to with psql. You might have multiple local PostgreSQL installs - especially if you are on a mac. Compare SHOW data_directory; output on the connections.

  • You've edited the output from pg_database and your DB isn't really called mydb, in which case the problem could be a typo, but is more likely to be with case-folding. Search for "PostgreSQL case-folding" to learn more.

  • You've found a really weird bug somewhere. Unlikely.

2
  • Thanks Craig for your time. Finally I could able to resolve this issue . I started uninstalling and installing openerp/postgresql/python multiple times ,but it didn't help. Finally uninstalled even jasper/ireport too along with above mentioned software.Probably second postgressql server was installed while installing ireport and openerp fails to find to my database mydb over there.(But not sure!) Jan 13, 2014 at 5:19
  • I will mark one of the possibilities (given below) indicated by Craig as correct answer . You're not connecting to the same server using OpenERP as you do with psql. The DB only exists on the server you connect to with psql. You might have multiple local PostgreSQL installs especially if you are on a mac. Compare SHOW data_directory; output on the connections. Jan 13, 2014 at 5:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.