Open tjbh opened 6 years ago
Have you tried starting Postgres server before connecting to database in the plugin? If it is then have a look here https://stackoverflow.com/questions/5500332/cant-connect-the-postgresql-with-psycopg2
From client machine: tyler@ubuntu:~$ psql -h datacube datacube Password: psql (10.4 (Ubuntu 10.4-0ubuntu0.18.04), server 9.6.9)
conn = psycopg2.connect(dbname="datacube", user="tyler", password=password, host="datacube", port="5432") cursor = conn.cursor() cursor.execute("select relname from pgclass where relkind='r' and relname !~ '^(pg|sql_)';") print(cursor.fetchall()) [('product_ranges',), ('sub_product_ranges',), ('dataset_location',), ('metadata_type',), ('dataset_type',), ('dataset',), ('dataset_source',)]
Try running same psycopg2 commands in qgis python console
Host: datacube.local (also tried by ip) Port: 5432 (have verified remote connection with psql)
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? (Background on this error at: http://sqlalche.me/e/e3q8)
Should the connection be made to a Unix domain socket when there's a network address in the connection settings?
OS: Linux ubuntu 4.15.0-23-generic #25-Ubuntu SMP Wed May 23 18:02:16 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux