February
Create the user you want to connect as (which is generally not the database owner, see example), and the database you want to connect to:
postgres=# CREATE USER lul_owner WITH NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT;
postgres=# CREATE DATABASE userlogger WITH OWNER lu_owner;
postgres=# CREATE USER lu_webadmin WITH NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT PASSWORD 'secret';
Note | |
---|---|
Make sure that the script that fills the database grant appropriate access to your connecting user, as in
|
hostssl userlogger lu_webadmin,lu_reader 10.0.2.13/32 md5
Note | |
---|---|
Be careful: entries in |
A reload is enough:
/etc/init.d/postgresql-
8.3
reload
psql -d userlogger -h dbhost.intranet -U lu_webadmin
Password for user lu_webadmin:
Welcome to psql 8.3.9 (server 8.3.7), the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256)
userlogger=>