minus34 / gnaf-loader

A quick way to get started with Geoscape's open GNAF & Admin Boundaries
Apache License 2.0
182 stars 66 forks source link

Postgres DB without a role named 'postgres' fails #3

Closed alexgleith closed 6 years ago

alexgleith commented 8 years ago

So running the script on a database without the postgres user role fails. (This is default when installing PG using homebrew, I think)

Here's the error:

`Part 1 of 3 : Start raw GNAF load : 2016-02-26 14:00:22.543925

I was able to get past this by creating a postgres role.

This is an assumption, which I assume is throughout the .sql files. Perhaps this 'OWNER' should be the database user, and find/replaced at runtime?

minus34 commented 8 years ago

Added code to replace 'postgres' user name in create tables script to input user name.

CMCDragonkai commented 6 years ago

I'm still getting this error currently at the master branch:

Traceback (most recent call last):
  File "./gnaf-loader/load-gnaf.py", line 951, in <module>
    if main():
  File "./gnaf-loader/load-gnaf.py", line 93, in main
    create_raw_gnaf_tables(pg_cur, settings)
  File "./gnaf-loader/load-gnaf.py", line 327, in create_raw_gnaf_tables
    pg_cur.execute(sql)
psycopg2.ProgrammingError: role "postgres" does not exist

It needs:

createuser postgres --superuser

To complete the load operation.

minus34 commented 6 years ago

Thanks, that was a bug that's now been fixed.