# issue setting up a psql backend

**URL:** <https://support.prodi.gy/t/issue-setting-up-a-psql-backend/29>\
**Category:** Uncategorized\
**Tags:** done, database\
**Created:** [September 11, 2017, 11:02pm UTC](https://support.prodi.gy/t/issue-setting-up-a-psql-backend/29 "2017-09-11T23:02:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![burton](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/burton/32/38_2.png) [@burton](https://support.prodi.gy/u/burton)\
**Post date:** [September 11, 2017, 11:02pm UTC](https://support.prodi.gy/t/issue-setting-up-a-psql-backend/29/1 "2017-09-11T23:02:20Z")

</div>

Hello! I’m finally getting up and running with `prodigy`, but have run into an issue at the tail end of the installation procedure. Instead of the default “sqlite” database, I prefer to use “postgresql”, so I created a db and added this information to my global `prodigy.json` configuration like so:

```json
    "db": "postgresql",
    "db_settings": {
        "postgresql": {
            "host": "localhost",
            "database": "prodigy",
            "port": 5432,
            "username": "burtondewilde"
        },
    },

```

When continuing on to “first steps” in the docs, I run into an issue:

```bash
(prodigy) ~$ prodigy dataset test_dataset "A dataset for testing" --author burton
Traceback (most recent call last):
  File "/Users/burtondewilde/.pyenv/versions/3.6.0/lib/python3.6/runpy.py", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/Users/burtondewilde/.pyenv/versions/3.6.0/lib/python3.6/runpy.py", line 142, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/Users/burtondewilde/.pyenv/versions/3.6.0/lib/python3.6/runpy.py", line 109, in _get_module_details
    __import__ (pkg_name)
  File "/Users/burtondewilde/.pyenv/versions/prodigy/lib/python3.6/site-packages/prodigy/ __init__.py", line 4, in <module>
    from . import recipes, about # noqa
  File "/Users/burtondewilde/.pyenv/versions/prodigy/lib/python3.6/site-packages/prodigy/recipes/ __init__.py", line 4, in <module>
    from . import ner, textcat, compare, terms, generic # noqa
  File "/Users/burtondewilde/.pyenv/versions/prodigy/lib/python3.6/site-packages/prodigy/recipes/ner.py", line 33, in <module>
    DB = connect()
  File "cython_src/prodigy/components/db.pyx", line 25, in prodigy.components.db.connect
  File "cython_src/prodigy/components/db.pyx", line 83, in prodigy.components.db.Database. __init__
  File "cython_src/prodigy/components/db.pyx", line 66, in prodigy.components.db.connect_postgresql
TypeError: __init__ () got multiple values for argument 'database'

```

I’m guessing that it doesn’t want me to specify my own database name? In that case, what _does_ it expect the database name to be? I would check in the code, but I’m embarrassed to admit that I don’t know how to inspect much of it because it’s in the form of `.so` files.

Sorry for the noob question, and thanks in advance for your help.

---

<div class="post-metadata">

**Author:** ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)\
**Post date:** [September 14, 2017, 11:49am UTC](https://support.prodi.gy/t/issue-setting-up-a-psql-backend/29/2 "2017-09-14T11:49:44Z")

</div>

Thanks for the report – just had a look and it seems like Prodigy is currently expecting a `name` as the database name, which is passed in as the `dbname` or `database` parameter. If none is found, it defaults to `prodigy`. So simply removing that line from your config should do as a quick workaround for now.

Just fixed this and the update will be included in the next release. Prodigy will now check for a `name`, `dbname` or `database` setting and use that instead.

Speaking of PostgreSQL: There seem to be another issue with the ORM at the moment that causes requests to fail, as PostgreSQL complains if a relation already exists – unlike SQLite (see [my comment over here](https://support.prodi.gy/t/error-in-loading-a-new-dataset/27/4?u=ines) for more details). This will also be fixed asap!

---

<div class="post-metadata">

**Author:** ![burton](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/burton/32/38_2.png) [@burton](https://support.prodi.gy/u/burton)\
**Post date:** [September 14, 2017, 9:46pm UTC](https://support.prodi.gy/t/issue-setting-up-a-psql-backend/29/3 "2017-09-14T21:46:31Z")

</div>

Brilliant, thanks for the fix and fix-to-come! I’ll use SQLite for now so I can get on with annotating, but will keep an eye out for the next release and switch to my preferred backend.

---

<div class="post-metadata">

**Author:** ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)\
**Post date:** [September 15, 2017, 11:59am UTC](https://support.prodi.gy/t/issue-setting-up-a-psql-backend/29/4 "2017-09-15T11:59:47Z")

</div>

Fixed and will be included in the next release – [see this comment](https://support.prodi.gy/t/error-in-loading-a-new-dataset-in-postgresql/27/5?u=ines) for details! 🎉
