Re: running postgresql - Mailing list pgsql-general

From Tom Lane
Subject Re: running postgresql
Date
Msg-id 26714.1194292473@sss.pgh.pa.us
Whole thread Raw
In response to running postgresql  (Charles <post@upyours.us>)
List pgsql-general
Charles <post@upyours.us> writes:
> I am running Gutsy (Ubuntu 7.10) and new to Postgresql. I followed the
> direction at https://help.ubuntu.com/community/PostgreSQL. I executed
> the following commands:
>     sudo -u postgres createuser -D -A -P myuser
>     sudo -u postgres createdb -O myuser mydb
>     dagon@DagonUX32:~$ psql mydb

> and received the following error message:
>     psql: FATAL:  role "dagon" does not exist.

> Apparently Postgresql gets confused with my login name.

There's no "confusion" about it: the default assumption for psql is that
your Postgres username is the same as your login name.  What else would
you have expected it to use?  If you want to use a different Postgres
username, you need to say so, eg

    psql -U myuser mydb

You might still have problems with that, because on many systems the
default user authentication method disallows logging in under a username
different from your login name.  I'm not sure if Ubuntu sets it up that
way, but if it does, you'd get something like "ident authorization
failed".  You'll need to read the manual chapter about client
authentication if you want to choose a different behavior, such as
password-based authentication.

In any case, using Postgres username equal to your login name is going
to save you lots of typing, so I'd suggest doing it that way unless you
have a really good reason not to...

            regards, tom lane

pgsql-general by date:

Previous
From: Erik Jones
Date:
Subject: Re: running postgresql
Next
From: Erik Jones
Date:
Subject: Re: Is there a way to tell how far along a COPY is in the process?