Re: running postgresql

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: post(at)upyours(dot)us
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: running postgresql
Date: 2007-11-05 19:54:33
Message-ID: 26714.1194292473@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Charles <post(at)upyours(dot)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(at)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-11-05 20:07:03 Re: Filter sequence
Previous Message Erik Jones 2007-11-05 19:54:15 Re: Is there a way to tell how far along a COPY is in the process?