I am a total novice with both PostGIS and Python - I am just trying to get this game running. I have followed the instructions here and here and am now at a dead end. I have pgAdmin 4 downloaded and running with PostGRESQL10 and the PostGIS extensions. However, when I try to set up the database with Python in Command Prompt (file location>python tools\set_up_db.py), I receive the following message:
Connecting to database
->host='localhost' port='5432' dbname='sessions' user='postgres' password='xxxxx'
CREATE TABLE IF NOT EXISTS dggrid (id BIGSERIAL PRIMARY KEY, gid bigint UNIQUE, geo geometry, center geometry, population int, employment int);
Traceback (most recent call last):
File "tools\set_up_db.py", line 22, in <module>
cursor.execute(query)
psycopg2.ProgrammingError: type "geometry" does not exist
LINE 1: ...(id BIGSERIAL PRIMARY KEY, gid bigint UNIQUE, geo geometry, ...
^
Looking around, it seems like this may be an issue with my Schema. My default Schema is "public," and I've tried to change the database's search path to "public, postgis," which hasn't helped. No idea if I'm on the right track here at all. As far as I can tell, I've done everything else correctly in the instructions...
postgres
. If you haven't created the PostGIS extension within the database (CREATE EXTENSION postgis
), you need to do that first, as per the documentation.