It seems that current code does not clearly explain why it could fail.
Maybe related to "psycopg2" dependency?
> failed to import module 'gramps.plugins.db.dbapi.postgresql';
the following exception was raised:
Traceback (most recent call last):
line 551, in import_object
File "gramps/plugins/db/dbapi/postgresql.py", line 27, in <module>
ImportError: No module named 'psycopg2'