Trying to create DB / user to import some data - Mailing list pgsql-general

From mdr
Subject Trying to create DB / user to import some data
Date
Msg-id 1380259727748-5772568.post@n5.nabble.com
Whole thread Raw
Responses Re: Trying to create DB / user to import some data  (Steven Schlansker <steven@likeness.com>)
Re: Trying to create DB / user to import some data  (John R Pierce <pierce@hogranch.com>)
List pgsql-general
I am new to Postgres but not to DBMS.
Running on Postgres 9.1 Ubuntu 13.04.

I log in as Postgres user: psql -h localhost -U postgres
and then I create a db and user and allow grants to the user like this:

create user import_dbms_user with password 'import_dbms';
create database import_dbms_db;
grant all privileges on database import_dbms_db to import_dbms_user;

\du shows:
 import_dbms_user |                                        | {}
 postgres | Superuser, Create role, Create DB, Replication | {}

In the pg_hba.conf I set as:
# local DATABASE USER METHOD [OPTIONS]
local import_dbms_db import_dbms_user md5
and restart Postgres.

However when I try to run psql from the command line:
psql -h localhost -U import_dbms_user -WI enter password when prompted
Password for user import_dbms_user:
psql: FATAL:  database "import_dbms_user" does not exist

But I get the error as above.

Trying to understand what I may be doing wrong.

Do I need to assign some kind of login role to import_dbms_user or such?

i assumed in the pg_hba.conf the line above is all I needed to log in
locally?
local import_dbms_db import_dbms_user md5

And instead of local I would enter IP address of machine from which I would
want to log in to the server?
192.168.1.10 import_dbms_db import_dbms_user md5

I am running on a VM and am trying to run some python scripts with psycopg2
to load some data.

So that script cannot log in either. Do I need to create any special role /
priviledge for that user to login from that script as well?

Thanks for your help!

Mono






--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Trying-to-create-DB-user-to-import-some-data-tp5772568.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


pgsql-general by date:

Previous
From: tuanhoanganh
Date:
Subject: Re: PlPython with pyodbc error DLL load failed: A dynamic link library (DLL) initialization routine failed.
Next
From: Steven Schlansker
Date:
Subject: Re: Trying to create DB / user to import some data