Thread: create user with password

create user with password

From
sarlav kumar
Date:
Hi All,
 
I logged in as postgres user and created a new user 'test' with a password.
create user test with password 'test';
 
But when I use the -U option to login with the new user 'test', it does not ask for password and directly logs me in. If I use -u(without capitalization), it asks for the username and password. I know that -u is deprecated. Is there a way to get -U option to ask for the password before logging in?? Or am I doing anything wrong here?
 
Thanks,
Saranya
 
 


Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.

Re: create user with password

From
Devrim GUNDUZ
Date:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hi,

On Mon, 20 Dec 2004, sarlav kumar wrote:

> I logged in as postgres user and created a new user 'test' with a password.
> create user test with password 'test';
>
> But when I use the -U option to login with the new user 'test', it does
> not ask for password and directly logs me in. If I use -u(without
> capitalization), it asks for the username and password. I know that -u
> is deprecated. Is there a way to get -U option to ask for the password
> before logging in?? Or am I doing anything wrong here?

You have to enable password authentication first:

http://www.postgresql.org/docs/7.4/interactive/client-authentication.html

Regards,
- --
Devrim GUNDUZ
devrim~gunduz.org                devrim.gunduz~linux.org.tr
             http://www.tdmsoft.com
             http://www.gunduz.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFBxu6mtl86P3SPfQ4RAnQCAJwPfDAULJAfTmq7H5dSIoLW/5nWygCfdmHK
n1S7P7xIEueDP9qftsuc7rk=
=YpZE
-----END PGP SIGNATURE-----

Re: create user with password

From
"Marcin Gil"
Date:
 

From: pgsql-novice-owner@postgresql.org [mailto:pgsql-novice-owner@postgresql.org] On Behalf Of sarlav kumar
Sent: Monday, December 20, 2004 4:19 PM
To: pgsqlnovice
Subject: [NOVICE] create user with password

Hi All,
 
I logged in as postgres user and created a new user 'test' with a password.
create user test with password 'test';
 
But when I use the -U option to login with the new user 'test', it does not ask for password and directly logs me in. If I use -u(without capitalization), it asks for the username and password. I know that -u is deprecated. Is there a way to get -U option to ask for the password before logging in?? Or am I doing anything wrong here?
 
Thanks,
Saranya
 

Re: create user with password

From
"Marcin Gil"
Date:


From: pgsql-novice-owner@postgresql.org [mailto:pgsql-novice-owner@postgresql.org] On Behalf Of sarlav kumar
Sent: Monday, December 20, 2004 4:19 PM
To: pgsqlnovice
Subject: [NOVICE] create user with password

Hi All,
 
I logged in as postgres user and created a new user 'test' with a password.
create user test with password 'test';
 
But when I use the -U option to login with the new user 'test', it does not ask for password and directly logs me in. If I use -u(without capitalization), it asks for the username and password. I know that -u is deprecated. Is there a way to get -U option to ask for the password before logging in?? Or am I doing anything wrong here?
 
Thanks,
Saranya
 
 
Check your pg_hba.conf in postgres directory.
Then check if you have 'trust' authentication for your local machine.
If so - then password is not required.
 
-Marcin Gil