Question
postgres access over the web
We have a successful implementation of a web page hosted on another provider. We are able to access our postgres database using javascript that calls python and uses psycopg2 to create a database connection. with that provider there seems to be less restrictions on access to the DB.
On Digital Ocean
After much research I realized I had to create a specific user in the postgres DB to allow access from a linux user:
For Example postgres Database:
database db1
Schema Public
Tables: testtable (owner root)
have granted full access on all tables to user jim ( also have a linux user jim)
In linux I can su to user jim and log into the database and see table testtable.
Now…
When I attempt to run the query through the web browser it seems like the connection is failing. I have also created a postgis user called “www-data” and granted full access to the tables.
I assumed was the browser user is using as user www-data.
So…
The questions I have are:
1) Am I correct in assuming that the web calls are made by “www-data”?
2) Does it sound like Is there something I have not configured to allow DB access from web/javascript/python?
Much thanks in advance:
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×