Re: Programmatically changing passwords

Поиск
Список
Период
Сортировка
От David Leangen
Тема Re: Programmatically changing passwords
Дата
Msg-id 90A14169-077A-4BB0-84BF-8B776DB98370@leangen.net
обсуждение исходный текст
Ответ на Re: Programmatically changing passwords  ("Joshua D. Drake" <jd@commandprompt.com>)
Ответы Re: Programmatically changing passwords  (Thomas Pundt <mlists@rp-online.de>)
Список pgsql-admin
Thank you! Reply below.

On Aug 10, 2006, at 13:59, Joshua D. Drake wrote:

> David Leangen wrote:
>> Hello!
>> I am trying to build an RPM package that will put my Postgres
>> installation into a known (usable) state, without requiring any
>> interaction.
>> To this effect, I need to do the following:
>> 1. set password for superuser
>> 2. createuser user
>> 3. createdb -O user dbname
>> No problems with (3) above. But for (1) and (2), how can I set the
>> passwords programmatically, since createuser does not let me do
>> this (requires interactive prompt from user)?
>
> ALTER USER foo with encrypted password 'bar';
> CREATE USER foo;
> CREATE DATABASE bar owner foo;


That makes perfect sense, but how can I do this from the shell? Is
there an easy way to wrap these so I can send them to postgres from
the shell?


Thank you!



В списке pgsql-admin по дате отправления:

Предыдущее
От: David Leangen
Дата:
Сообщение: Re: Programmatically changing passwords
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Programmatically changing passwords