Reputation: 151
I upgraded PythonAnywhere to the $99 startup plan and created a PostgreSQL database. The PythonAnywhere database page shows:
Address: magula6-1249.postgres.pythonanywhere-services.com
Port: 11249
Superuser role name: super
I want to populate my new database from a pg-dump file created on my macbook.
I’ve tried several variations of:
$ psql -H magula6-1249.postgres.pythonanywhere-services.com -U super -p
11249 -f 2019_7_30_pgdump.sql
psql: 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.11249"?
I also tried:
postgres=# \i /home/magula6/cogswatch/2019_7_30_pgdump.sql
tpsql:/home/magula6/cogswatch/2019_7_30_pgdump.sql:149: ERROR: function "function_correctiveaction" already exists with s
ame argument types
Oddly the Pythonanywhere database page says:
Postgres disk usage:
100% full (1.0 GB of your 1.0 GB quota)
but the database appears empty:
postgres=# \d
No relations found.
Upvotes: 1
Views: 220
Reputation: 151
The answer:
postgres=# grant usage on schema public to public;
postgres=# grant create on schema public to public;
postgres=# \d
(all my tables appear - amazing)
Upvotes: 1