dbTalk Databases Forums  

'-U postgres' doesn't authenticate

comp.databases.postgresql.novice comp.databases.postgresql.novice


Discuss '-U postgres' doesn't authenticate in the comp.databases.postgresql.novice forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Derek Fountain
 
Posts: n/a

Default '-U postgres' doesn't authenticate - 10-18-2004 , 02:27 AM






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:

Quote:
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?


Reply With Quote
  #2  
Old   
Nikki
 
Posts: n/a

Default Re: '-U postgres' doesn't authenticate - 10-18-2004 , 09:45 AM






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

Quote:
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


Reply With Quote
  #3  
Old   
Bruno Wolff III
 
Posts: n/a

Default Re: '-U postgres' doesn't authenticate - 10-20-2004 , 10:49 AM



On Mon, Oct 18, 2004 at 15:27:28 +0800,
Derek Fountain <nospam (AT) example (DOT) com> wrote:
Quote:
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?
You need to say that it is OK for your linux account to connect as postgres.
You do this by changing pg_ident.conf. I think just doing a SIGHUP after
the change is enough to get the file reread.

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.