Re: Programmatically changing passwords - Mailing list pgsql-admin

From Thomas Pundt
Subject Re: Programmatically changing passwords
Date
Msg-id 200608100736.36463.mlists@rp-online.de
Whole thread Raw
In response to Re: Programmatically changing passwords  (David Leangen <postgres@leangen.net>)
Responses Re: Programmatically changing passwords  (David Leangen <postgres@leangen.net>)
List pgsql-admin
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/ ----

pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: Programmatically changing passwords
Next
From: David Leangen
Date:
Subject: Re: Programmatically changing passwords