pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: John Jensen <JRJ@ft.fo>
To: klodoma@ar-sd.net
To: iain@mst.co.jp
To: pgsql-admin@postgresql.org
Subject: Re: Win32 Postgresql Command Line Password
Date: Tue, 08 Feb 2005 09:36:15 +0000
Message-ID: <s208882e.054@fs3.ft.fo> (raw)

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" <iain@mst.co.jp> 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. 



view thread (5+ messages)  latest in thread

Message-ID: <s208882e.054@fs3.ft.fo>
Permalink:  ../s208882e.054@fs3.ft.fo/
Also on:    postgresql.org/message-id/s208882e.054@fs3.ft.fo

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: JRJ@ft.fo, klodoma@ar-sd.net, iain@mst.co.jp
  Subject: Re: Win32 Postgresql Command Line Password
  In-Reply-To: <s208882e.054@fs3.ft.fo>
  References: <s208882e.054@fs3.ft.fo>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox