Re: [Re: Password?]

From: Andreas Wenk <a(dot)wenk(at)netzmeister-st-pauli(dot)de>
To: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [Re: Password?]
Date: 2009-07-08 13:19:56
Message-ID: 4A549CFC.9050404@netzmeister-st-pauli.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jasen Betts schrieb:
> On 2009-07-08, Andreas Wenk <a(dot)wenk(at)netzmeister-st-pauli(dot)de> wrote:
>> Serge Fonville schrieb:
>>>> *argh* - more detailed to avoid confusion. The auth method 'password' in
>>>> pg_hba.conf means, that you will be asked for a password for the user you
>>>> try to create a db with. If no user is given (with createdb -U [username]),
>>>> this user is postgres ...
>>> Wasn't it that it uses the currently logged on user is used if no user
>>> is specified?
>> correct - so this will be postgres because other users are not allowed to use these
>> programs ...
>>
>> /var/lib/postgresql/8.4/bin$ ./createdb test -p 5433
>> createdb: could not connect to database postgres: FATAL: role "duke" does not exist
>>
>> $ sudo su postgres
>> postgres(at)duke-linux:~/8.4/bin$ ./createdb test -p 5433
>> postgres(at)duke-linux:~/8.4/bin$
>>
>> auth method in pg_hba.conf is trust in this case.
>
> if it's "trust" any user can do
>
> ~postgres/8.4/bin/createdb -U postgres -p 5433 test

nope! what you did is calling createdb as system user postgres (I believe because of the ~
sign at the beginning) *and* giving the option -U postgres. That works for sure and you
even don't need -U postgres since you are allready postgres. But leave -U postgres away as
a system user not equal to postgres ... see my example above.

Cheers

Andy

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2009-07-08 13:58:43 Re: "= Null" <> "is Null"?
Previous Message Jasen Betts 2009-07-08 13:04:14 Re: [Re: Password?]