Unix Technical Forum

assigning password from script

This is a discussion on assigning password from script within the Pgsql General forums, part of the PostgreSQL category; --> Hello All, I want to create a user through script and dont want user to assign password interactively, I ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-09-2008, 06:12 PM
Ashish Karalkar
 
Posts: n/a
Default assigning password from script

Hello All,

I want to create a user through script and dont want user to assign password interactively, I want it to be assigned through some file or anything else

some this like

createuser -P ***** OR createuser -P <file >

Is there any way?


Thanks in Advance

With Regards
Ashish...


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-09-2008, 06:12 PM
Ashish Karalkar
 
Posts: n/a
Default Re: assigning password from script

Thanks for your replay Scott,

I am using just sql script
and there is no option like pwd with createuser command

With Regards
Ashish...

----- Original Message -----
From: "Scott Marlowe" <scott.marlowe@gmail.com>
To: "Ashish Karalkar" <ashish.karalkar@info-spectrum.com>
Sent: Monday, July 02, 2007 11:17 AM
Subject: Re: [GENERAL] assigning password from script


> On 7/2/07, Ashish Karalkar <ashish.karalkar@info-spectrum.com> wrote:
>>
>>
>> Hello All,
>>
>> I want to create a user through script and dont want user to assign
>> password
>> interactively, I want it to be assigned through some file or anything
>> else
>>
>> some this like
>>
>> createuser -P ***** OR createuser -P <file >
>>
>> Is there any way?

>
> What scripting language are you using?
>
> in bash you can do something like:
>
> pwd=`cat /home/pgsql/password`
>
> to get it.



---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-09-2008, 06:12 PM
Pavel Stehule
 
Posts: n/a
Default Re: assigning password from script

Hello

look on http://www.postgresql.org/docs/8.0/i...pq-pgpass.html

Pavel Stehule

2007/7/2, Ashish Karalkar <ashish.karalkar@info-spectrum.com>:
>
>
> Hello All,
>
> I want to create a user through script and dont want user to assign password
> interactively, I want it to be assigned through some file or anything else
>
> some this like
>
> createuser -P ***** OR createuser -P <file >
>
> Is there any way?
>
>
> Thanks in Advance
>
> With Regards
> Ashish...
>
>


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-09-2008, 06:13 PM
Ashish Karalkar
 
Posts: n/a
Default Re: assigning password from script

----- Original Message ----- >
> 2007/7/2, Ashish Karalkar <ashish.karalkar@info-spectrum.com>:
>
>
> Hello All,
>
> I want to create a user through script and dont want user to assign
> password
> interactively, I want it to be assigned through some file or anything
> else
>
> some this like
>
> createuser -P ***** OR createuser -P <file >
>
> Is there any way?

From: "Pavel Stehule" <pavel.stehule@gmail.com>
To: "Ashish Karalkar" <ashish.karalkar@info-spectrum.com>
Cc: <pgsql-general@postgresql.org>
Sent: Monday, July 02, 2007 11:24 AM
Subject: Re: [GENERAL] assigning password from script


>> Hello
> >
> >look on http://www.postgresql.org/docs/8.0/i...pq-pgpass.html
> >
> >Pavel Stehule

Thanks Pavel Stehule for your replay,

As far as I understand the guide lines talk about providing the password
from .pgpass whene ever server requires it and not to assign the password to
the user.

" The file .pgpass in a user's home directory or the file referenced by
PGPASSFILE can contain passwords to be used if the connection requires a
password"


Please correct me if I am wrong and if I understood correctly then Please
suggest me the way to assign password to user while its creation from a
file/ or anything else than prompting for password from terminal


With Regards
Ashish....


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org/

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-09-2008, 06:13 PM
Pavel Stehule
 
Posts: n/a
Default Re: assigning password from script

Hello

try

psql postgres -c "create role tom login password 'hello'"

Regards
Pavel


2007/7/3, Ashish Karalkar <ashish.karalkar@info-spectrum.com>:
> ----- Original Message ----- >
> > 2007/7/2, Ashish Karalkar <ashish.karalkar@info-spectrum.com>:
> >
> >
> > Hello All,
> >
> > I want to create a user through script and dont want user to assign
> > password
> > interactively, I want it to be assigned through some file or anything
> > else
> >
> > some this like
> >
> > createuser -P ***** OR createuser -P <file >
> >
> > Is there any way?

> From: "Pavel Stehule" <pavel.stehule@gmail.com>
> To: "Ashish Karalkar" <ashish.karalkar@info-spectrum.com>
> Cc: <pgsql-general@postgresql.org>
> Sent: Monday, July 02, 2007 11:24 AM
> Subject: Re: [GENERAL] assigning password from script
>
>
> >> Hello
> > >
> > >look on http://www.postgresql.org/docs/8.0/i...pq-pgpass.html
> > >
> > >Pavel Stehule

> Thanks Pavel Stehule for your replay,
>
> As far as I understand the guide lines talk about providing the password
> from .pgpass whene ever server requires it and not to assign the password to
> the user.
>
> " The file .pgpass in a user's home directory or the file referenced by
> PGPASSFILE can contain passwords to be used if the connection requires a
> password"
>
>
> Please correct me if I am wrong and if I understood correctly then Please
> suggest me the way to assign password to user while its creation from a
> file/ or anything else than prompting for password from terminal
>
>
> With Regards
> Ashish....
>
>


---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:23 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com