3 ms·
Why connect to template1? It should be invisible. Create a user and a database for your webapp. Matching the unix account name is the simplest way to do that.
by obtu 15y ago
Why connect to template1? It should be invisible. Create a user and a database for your webapp. Matching the unix account name is the simplest way to do that.
In pg_hba.conf, let unix users authenticate as matching PostgreSQL users:
local all all peer
The postgres user on Debian/Ubuntu can create users and databases:
sudo -u postgres createuser -SRD webappuser
sudo -u postgres createdb webappuser --owner=webappuser
sudo -u webappuser psql