Re: How add db users from shell script with their passwords?

From: Achilleas Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Cc: "Medi Montaseri" <montaseri(at)gmail(dot)com>, " Илья =?utf-8?q?_=D0=A1=D0=BA=D0=BE=D1=80=D0=B8=D0=BA?=" <ilya(dot)skorik(at)inprint(dot)ru>
Subject: Re: How add db users from shell script with their passwords?
Date: 2008-06-03 10:00:02
Message-ID: 200806031300.03277.achill@matrix.gatewaynet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Στις Tuesday 03 June 2008 11:28:44 ο/η Medi Montaseri έγραψε:
> You can write a program in say Perl and use "create user bob with
> .....options ....encrypted password xxxxx valid until xxx " which is pretty
> much what createuser(1) does.
>

why not just

#!/bin/sh
psql -c "CREATE USER foo PASSWORD 'bar'"

> Cheers
> Medi
>
> On Tue, Jun 3, 2008 at 12:54 AM, Илья Скорик <ilya(dot)skorik(at)inprint(dot)ru> wrote:
>
> > Dear community, help please.
> >
> > I need to add some standard users to database together with their
> > standard passwords from a shell script. That the script would not ask
> > to enter passwords manually for each user. How it can be made?
> >
> > How I have understood, createuser comand does not allow to make it?
> >
> > In advance thanks.
> >
> > --
> > --
> > С уважением, Илья Скорик
> > специалист
> > Inprint - автоматизация вашего издательства
> >
> > Yours faithfully, Ilya Skorik
> > the expert
> > Inprint - automation of your publishing house
> >
> > e-mail: ilya(dot)skorik(at)inprint(dot)ru
> > web: http://www.inprint.ru/
> >
> > --
> > Sent via pgsql-admin mailing list (pgsql-admin(at)postgresql(dot)org)
> > To make changes to your subscription:
> > http://www.postgresql.org/mailpref/pgsql-admin
> >
>

--
Achilleas Mantzios

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Rommel the iCeMAn 2008-06-03 13:43:34 Re: UUID generation functions
Previous Message Medi Montaseri 2008-06-03 08:28:44 Re: How add db users from shell script with their passwords?