Re: '-U postgres' doesn't authenticate

From: Nikki <user(at)ccount(dot)dot>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: '-U postgres' doesn't authenticate
Date: 2004-10-18 14:45:29
Message-ID: 191020040045284790%user@ccount.dot
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

In article
<41736ee7$0$25578$5a62ac22(at)per-qv1-newsreader-01(dot)iinet(dot)net(dot)au>, Derek
Fountain <nospam(at)example(dot)com> wrote:

> I'm using PG-7.4.2 on a SUSE-9.1 box. The docs say that I need to be the
> 'postgres' user in order to do things like create databases, which makes
> sense. If I switch to that user (using 'su') it works fine, but if I use
> the -U switch from my own Linux account I get an error:
>
> >createdb -U postgres test
> createdb: could not connect to database template1: FATAL: IDENT
> authentication failed for user "postgres"
>
> My understanding is that this should work, and it would be a useful shortcut
> for me if it did. Do I misunderstand or have SUSE set something in the
> config to disable this feature?

Hi Derek

I'm novice myself, but your experiences sound familiar. I'm the only
one using my system and network, so I'm root, postgres, and cleaning
staff.

1) different distros place the files in differenty. I have postgresql
on an OSX Mac, and on a Debian system - the same files are installed in
quite different places. So you must a) check where 'createdb' and the
other commands are

find / -name createdb

and b) which directory the 'data' is in. It won't be the same.

then include the path in the command, or cd to that directory and issue
the coammand from there. Add the path via your shell. It may be a good
idea to do that AFTER you've created a user (and place the new drectory
in his/her .profile).

2) as 'postgres' you can add users and give them permission to create
dbs and even add more users. You don't actually have to be 'postgres'
for much. I generally use

su - postgres

otherwise I'm running postgresql from my everyday username, pretty much
as I'd use emacs or anything.

Hope this helps. Good Luck

Nikki

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Andreas 2004-10-18 15:30:47 Re: Getting Started
Previous Message Nikki 2004-10-18 14:45:27 Re: Getting Started