X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 6D05B9FB2D5 for ; Thu, 10 Aug 2006 02:36:38 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 53423-06 for ; Thu, 10 Aug 2006 05:36:34 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 943129FB2C5 for ; Thu, 10 Aug 2006 02:36:34 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from mail.rp-online.de (mail.rp-online.de [149.221.1.199]) by svr4.postgresql.org (Postfix) with ESMTP id ADCBC5AF02A for ; Thu, 10 Aug 2006 05:36:33 +0000 (GMT) Received: from idefix.d.rp-online.de (idefix.d.rp-online.de [149.221.100.194]) by mail.rp-online.de (Postfix) with ESMTP id AACEF2DF36; Thu, 10 Aug 2006 07:36:30 +0200 (CEST) From: Thomas Pundt Reply-To: Thomas Pundt Organization: RP Online Verlagsgesellschaft mbH To: pgsql-admin@postgresql.org, David Leangen Subject: Re: Programmatically changing passwords Date: Thu, 10 Aug 2006 07:36:36 +0200 User-Agent: KMail/1.9.4 References: <7176B83D-AF04-4FB9-AE6D-776660B95257@leangen.net> <44DABD48.2000007@commandprompt.com> <90A14169-077A-4BB0-84BF-8B776DB98370@leangen.net> In-Reply-To: <90A14169-077A-4BB0-84BF-8B776DB98370@leangen.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608100736.36463.mlists@rp-online.de> X-Anti-Virus: Kaspersky Anti-Virus for MailServers 5.5.3/RELEASE, bases: 10082006 #201052, status: clean X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.069 tagged_above=0 required=5 tests=SPF_NEUTRAL X-Spam-Level: * X-Archive-Number: 200608/131 X-Sequence-Number: 22674 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 ---- http://rp-online.de/ ----