X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 56A488B9E84 for ; Tue, 8 Feb 2005 10:08:05 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 97707-09 for ; Tue, 8 Feb 2005 10:07:52 +0000 (GMT) Received: from millenium.mst.co.jp (millenium.mst.co.jp [210.251.240.193]) by svr1.postgresql.org (Postfix) with ESMTP id 942828B9B6C for ; Tue, 8 Feb 2005 10:07:52 +0000 (GMT) Received: from mst1x5r347kymb (lc12114 [192.168.1.114]) by millenium.mst.co.jp (8.11.6p2/3.7W) with SMTP id j18A6oQ24176; Tue, 8 Feb 2005 19:06:50 +0900 Message-ID: <001701c50dc6$56305160$7201a8c0@mst1x5r347kymb> From: "Iain" To: "John Jensen" , , References: Subject: Re: Win32 Postgresql Command Line Password Date: Tue, 8 Feb 2005 19:09:49 +0900 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.012 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/64 X-Sequence-Number: 16232 Hi John, I havn't spent much time in that section of the documentation, a situation which should probably be rectified. Using ~/.pgpass would seem to do the job, and may even be a good solution under unix/linux. I don't feel qualified to get into a debate over the relative pros and cons of trust vs .pgpass, but maybe someone else has something to say. Also, I noticed that the PGPASSPORD environment variable is deprecated, so probably best to avoid it if possible. regards Iain ----- Original Message ----- From: "John Jensen" To: ; ; Sent: Tuesday, February 08, 2005 6:36 PM Subject: Re: [ADMIN] Win32 Postgresql Command Line Password > This might not apply to the win32 version. But in the Unix version you > can > put this information in a .pgpass file. This enables you to keep > passwords > on all user accounts and still be able to automate tasks. > > There is a number of permission/ownership requirements on this file in > the Unix version. These might not be compatible with win32 so use at > your > own perril ;-). And check the manual ... > > I currently use this approach on a Linux box for automating the > maintenance > tasks through cron jobs. > > Cheers, > John > >>>> "Iain" 08-02-2005 08:37:54 >>> > I think that's the best way to do it. > > Rather than leave passwords lying around in script files, it might be > best > to trust a specific (specially created) user when running from a > specific > location on the specific database. Then you just have to keep that user > > account secure. I can imagine how it would work wth linux, but am not > sure > what problems youmay face under windows. > > The only other alternative I can imagine is to use another program to > type > the password in automatically. I've never done it but I'm sure such a > beast > must exist. > > The long and the short of it is (at least upto 7.4.6 - I don't know > about > later versions) thereis no way to specify the password on the > commandline. > > Regards > Iain > ----- Original Message ----- > From: Andrei Bintintan > To: pgsql-admin@postgresql.org > Sent: Tuesday, February 08, 2005 5:11 PM > Subject: [ADMIN] Win32 Postgresql Command Line Password > Specification > > > Hi, > > I have to run some command line commands that I have to run on a > windows > machine. Like pgsql, dropdb, createdb etc. > All these commands are runned from a php scripts. > > Now, my question is how can I specify a User and Password to > postgresql > database system. I found out how can I say the user, but the password > is > always asked in the command line. I need this also to be specified in > the > command. > > for example: dropdb database1 -U postgres -W.... always ask a > password in > the command line. > I want to specify in the command line the pass. > > The only solution that I found for this problem is to put the postgre > user > autentication to trust and to skip the password. > > Andy. > > ---------------------------(end of broadcast)--------------------------- > TIP 7: don't forget to increase your free space map settings