1
votes

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
1
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.Craig Ringer
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 thisuser3153567
So you database is really called mydb? You haven't edited/replaced that name? It's not really named OpenERPDatabase or something?Craig Ringer

1 Answers

1
votes

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.