Re: Trying to create DB / user to import some data

From: Steven Schlansker <steven(at)likeness(dot)com>
To: mdr <monosij(dot)forums(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Trying to create DB / user to import some data
Date: 2013-09-27 05:40:00
Message-ID: C5F0211D-D6A2-47AB-8167-EEF1263F4CA9@likeness.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Sep 26, 2013, at 10:28 PM, mdr <monosij(dot)forums(at)gmail(dot)com> wrote:
>
> create user import_dbms_user with password 'import_dbms';
> create database import_dbms_db;
> grant all privileg

> 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.

By default, psql will try to use the username as the database name if it is not specified.
Since your database name is different from the user, this does not work.

You could either name both your user and db "import_dbms" and have the default work, or specify the database explicitly with "-d import_dbms_db"

Hope that helps.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Kretschmer 2013-09-27 07:24:44 question about hstore and indexes
Previous Message mdr 2013-09-27 05:28:47 Trying to create DB / user to import some data