Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 70A132E0043 for ; Wed, 20 Feb 2008 03:30:46 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 17741-03-5 for ; Wed, 20 Feb 2008 03:30:39 -0400 (AST) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.180]) by postgresql.org (Postfix) with ESMTP id 420DE2E005A for ; Wed, 20 Feb 2008 03:30:42 -0400 (AST) Received: by py-out-1112.google.com with SMTP id d37so4293451pye.29 for ; Tue, 19 Feb 2008 23:30:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=jqVanA5xptQ437vDOs6XHZYnnEPCDASu2qSg3rEnz/Y=; b=jKlKtwCLSGhv1VTCTH1ZGT78YaCcI4Sl3cGC/Tu3L9Y/Ls7lKmHDj4DDqJhsa/3vMpdnLH5qf2BOVceiTMemW/xABTvvZ5P6REwwHFmU+UP0x1E6ZPxpPttpCxQGXbprwGIgFgb3IkLTPvLqNuFn4w+Te+xUy43jNJYAsMuwo0k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=T2dJbQdugeC3R3okC7Y78j+Uad+yqZJ1f5ZKUuwVrtfDb8G7ZsvAJ7RwDZrqcHExWbY3UTvzh2jArX6yCiS+1J6QDxflHkpGE6d40vTApMgQ02KxXfLKSPH6Ijz3LCr7WvnA+3PYUZ4UxbJ9OXDVlPgeER83JWyGvfZ0tpeA5kA= Received: by 10.140.172.6 with SMTP id u6mr5426806rve.192.1203492641001; Tue, 19 Feb 2008 23:30:41 -0800 (PST) Received: by 10.141.152.4 with HTTP; Tue, 19 Feb 2008 23:30:40 -0800 (PST) Message-ID: <238696420802192330g69e3c447jeadd1d3d31506eda@mail.gmail.com> Date: Wed, 20 Feb 2008 13:00:40 +0530 From: "Rajiv Rajaian" To: pgsql-admin@postgresql.org Subject: How to create a new user with password in commandline with no prompt for password MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_5827_12542896.1203492640979" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.002 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001, NORMAL_HTTP_TO_IP=0.001 X-Spam-Level: X-Archive-Number: 200802/223 X-Sequence-Number: 28297 ------=_Part_5827_12542896.1203492640979 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi all Im using postgresql-8.0.3-1. I need to create a new user in postgresql with password ..But it should not prompt me to get the password ..ie only through command line I've to give the password as input Steps i had done are as follows [root@g151 ~]# su postgres -c "createuser -A -d globus" could not change directory to "/root" CREATE USER [root@g151 ~]# su globus -c "createdb rftDatabase" could not change directory to "/root" CREATE DATABASE Also in /var/lib./pgsql/data/pg_hba.conf I ve added the entry as host rftDatabase "globus" "172.16.10.151" 255.255.255.0 md5 Now when i tried to login to that database I got the following error [root@g151 ~]# psql -U globus -d rftdatabase psql: FATAL: Ident authentication failed for user "globus" Also with password promt it was prompting password ..But I haven't created the user with password [root@g151 ~]# psql -U globus -d rftdatabase -W Password: Is it possible to create any new user in postgresql with password through command line and with no prompt for password.??Is there any option in Postgresql? Also if I create a new user with su postgres -c "createuser -A -d globus" .Will it set any default password while creating the user ?? Please I need some valuable suggestion s Thanks /Regards Rajiv Project Associate CARE,MIT, Anna University ------=_Part_5827_12542896.1203492640979 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi all
Im using postgresql-8.0.3-1.
I need to create a new user in postgresql with password ..But it should not prompt me to get the password ..ie only through command line I've to give the password as input
Steps i had done are as follows

[root@g151 ~]# su postgres -c "createuser -A -d  globus"
could not change directory to "/root"
CREATE USER

[root@g151 ~]# su globus -c "createdb rftDatabase"
could not change directory to "/root"
CREATE DATABASE

Also in /var/lib./pgsql/data/pg_hba.conf I ve added the entry as

host    rftDatabase     "globus"        "172.16.10.151"  255.255.255.0   md5

Now when i tried to login to that database I got the following error

[root@g151 ~]# psql -U globus -d rftdatabase
psql: FATAL:  Ident authentication failed for user "globus"

Also with password promt it was prompting password ..But I haven't created the user with password
 [root@g151 ~]# psql -U globus -d rftdatabase -W
Password:     


Is it possible to create any new user in postgresql with password through command line and with no prompt for password.??Is there any option in Postgresql?
Also  if  I create  a new user with su postgres -c "createuser -A -d  globus" .Will it set any default password while creating the user ??

Please I need some valuable suggestion s

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






------=_Part_5827_12542896.1203492640979--