Thread: postgresql database password

postgresql database password

From
Reed Kempf
Date:
Hello all,

I am new to postgres but have a pretty extensive background in Oracle.  I need a little help starting out with some basic concepts.

I have downloaded 8.1 on my linux box and have created a database called test.  I also have created a login role called test with password <test>. 

I use this login from the linux command line.  psql -h localhost -p 5432 -U test -W

I read that the -W prompts for a password.  I give the password test which I set up when I created the user test and it let me in.  The problem is I also run the same command line login and didn't specify a password.

Am I missing something with authentication, perhaps a config file setting.

In Oracle, the heirarchy is server -> database -> schema(s).  The database itself would not have a password associated with it but each schema would to be able to access their objects within the database with a password (or not).

It appears that postgresql works a bit differently.  I have looked in the documentation for 8.1 but nothing seems to jump out at me.

Any help or pointers in the right direction would be awesome.

Regards,

ReedK

Re: postgresql database password

From
Tom Lane
Date:
Reed Kempf <rkempf@gmail.com> writes:
> I read that the -W prompts for a password. I give the password test which I
> set up when I created the user test and it let me in. The problem is I also
> run the same command line login and didn't specify a password.
> Am I missing something with authentication, perhaps a config file setting.

Yup.  Password authentication is not the default, you need to adjust
pg_hba.conf if you want to use it.  See "Client Authentication" in the
manual.

            regards, tom lane