Re: Programmatically changing passwords

From: Thomas Pundt <mlists(at)rp-online(dot)de>
To: pgsql-admin(at)postgresql(dot)org, David Leangen <postgres(at)leangen(dot)net>
Subject: Re: Programmatically changing passwords
Date: 2006-08-10 05:36:36
Message-ID: 200608100736.36463.mlists@rp-online.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)pundt(at)rp-online(dot)de> ---- http://rp-online.de/ ----

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message David Leangen 2006-08-10 06:06:52 Re: Programmatically changing passwords
Previous Message Tom Lane 2006-08-10 05:36:17 Re: Programmatically changing passwords