From: Thomas Pundt <mlists@rp-online.de>
To: pgsql-admin@postgresql.org, David Leangen <postgres@leangen.net>
Subject: Re: Programmatically changing passwords
Date: Thu, 10 Aug 2006 07:36:36 +0200
Message-ID: <200608100736.36463.mlists@rp-online.de> (raw)
In-Reply-To: <90A14169-077A-4BB0-84BF-8B776DB98370@leangen.net>
References: <7176B83D-AF04-4FB9-AE6D-776660B95257@leangen.net>
<44DABD48.2000007@commandprompt.com>
<90A14169-077A-4BB0-84BF-8B776DB98370@leangen.net>
On Thursday 10 August 2006 07:12, David Leangen wrote:
| > 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?
yes; the following should work:
#!/bin/bash
psql <<_EOT_
ALTER USER foo with encrypted password 'bar';
CREATE USER foo;
CREATE DATABASE bar owner foo;
_EOT_
Ciao,
Thomas
--
Thomas Pundt <thomas.pundt@rp-online.de> ---- http://rp-online.de/ ----
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: mlists@rp-online.de, postgres@leangen.net
Subject: Re: Programmatically changing passwords
In-Reply-To: <200608100736.36463.mlists@rp-online.de>
References: <7176B83D-AF04-4FB9-AE6D-776660B95257@leangen.net> <44DABD48.2000007@commandprompt.com> <90A14169-077A-4BB0-84BF-8B776DB98370@leangen.net> <200608100736.36463.mlists@rp-online.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox