X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id CD4D09FB2C5 for ; Thu, 10 Aug 2006 03:06:35 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 14908-07 for ; Thu, 10 Aug 2006 03:06:28 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from leangen.net (pee5958.osakff01.ap.so-net.ne.jp [202.238.89.88]) by postgresql.org (Postfix) with SMTP id 814FD9FB2C1 for ; Thu, 10 Aug 2006 03:06:26 -0300 (ADT) Received: (qmail 21027 invoked from network); 10 Aug 2006 06:26:48 -0000 Received: from pee5980.hyogff01.ap.so-net.ne.jp (HELO ?192.168.2.4?) (202.238.89.128) by leangen.net with SMTP; 10 Aug 2006 06:26:48 -0000 Mime-Version: 1.0 (Apple Message framework v750) 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> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <5EF713B4-80FE-4BF8-ACFD-749F19CF42DC@leangen.net> Content-Transfer-Encoding: 7bit From: David Leangen Subject: Re: Programmatically changing passwords Date: Thu, 10 Aug 2006 15:06:52 +0900 To: pgsql-admin@postgresql.org X-Mailer: Apple Mail (2.750) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.185 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200608/132 X-Sequence-Number: 22675 Awesome, thank you! That is exactly what I needed. Didn't know it was that simple... duh! On Aug 10, 2006, at 14:36, Thomas Pundt wrote: > 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/ > ---- > > ---------------------------(end of > broadcast)--------------------------- > TIP 5: don't forget to increase your free space map settings