Skip site navigation (1) Skip section navigation (2)

Re: How to create a new user with password in commandline with no prompt for password

From: "Rajiv Rajaian" <rajiv(dot)pgsql(at)gmail(dot)com>
To: "Vishal Arora" <aroravishal22(at)hotmail(dot)com>
Subject: Re: How to create a new user with password in commandline with no prompt for password
Date: 2008-02-20 11:11:20
Message-ID: 238696420802200311y40a93a38jbd601e280d2fb860@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-adminpgsql-es-ayuda
Hi Vishal

Now I m able to create new user using command line
I ve created a database named 'postgres' for postgres user and I ve created
the new user  in  comand line

The steps I ve used


[root(at)g151 ~]# su postgres -c "createdb postgres"
could not change directory to "/root"
CREATE DATABASE
[root(at)g151 ~]# echo "CREATE USER globus WITH PASSWORD 'globus' CREATEDB;" |
psql -U postgres -d postgres
psql: FATAL:  Ident authentication failed for user "postgres"
[root(at)g151 ~]# su postgres -c "echo \"CREATE USER globus WITH PASSWORD
'globus' CREATEDB;\" | psql -U postgres -d postgres"
could not change directory to "/root"
CREATE USER
[root(at)g151 ~]# su globus -c "createdb rftDatabase"
could not change directory to "/root"
CREATE DATABASE



Thanks to Vishal, Shane and pgsql-admin list

Thanks/Regards
Rajiv
Project Associate,
CARE,MIT,
Anna University

In response to

Responses

pgsql-admin by date

Next:From: Tom LaneDate: 2008-02-20 16:10:28
Subject: Re: Power outage borked things (8.1.10)...
Previous:From: ALFDate: 2008-02-20 10:35:32
Subject: Re: [Admin]Update 8.2.to 8.3

pgsql-es-ayuda by date

Next:From: marcelo CortezDate: 2008-02-20 12:22:20
Subject: Re: tsearch2 vs. like
Previous:From: Rajiv RajaianDate: 2008-02-20 10:19:42
Subject: Re: How to create a new user with password in commandline with no prompt for password

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group