Re: psql shell with no password prompt

From: Walter Willmertinger <willmis(at)gmail(dot)com>
To: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: psql shell with no password prompt
Date: 2010-07-28 21:02:47
Message-ID: AANLkTin_EchXp35CLiUBRvPz5KzN_T=n9qtdyAhGY4aJ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

I hope the method with the environment variables will hold on.

For security reasons it is much better to use the variable method with
PGPASSWORD. I can set the environment hidden from any user by a program.
The .pgpass is readable for any admin, opposed to the statement in the docs:
"On Microsoft Windows, it is assumed that the file is stored in a directory
that is secure, so no special permissions check is made."

Regards
Walter

On Wed, Jul 28, 2010 at 1:02 AM, Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>wrote:

> However, those are deprecated, and the .pgpass is considered the
> preferred method.
>
> On Tue, Jul 27, 2010 at 3:56 PM, Walter Willmertinger <willmis(at)gmail(dot)com>
> wrote:
> > You can set user and password with environment variables (PGUSER and
> > PGPASSWORD) , also in a Windows batch or program.
> > SET PGPASSWORD=xxxyyyzzz
> > psql -U "dbadmin" -d mydb -f D:\script.sql
> >
> >
> >
> > Regards
> >
> > Walter
> >
> >
> > On Tue, Jul 27, 2010 at 6:53 PM, <Steve(dot)Toutant(at)inspq(dot)qc(dot)ca> wrote:
> >>
> >> Hi,
> >> I created several SQL that are automatically executed via windows task
> >> scheduler, here is an example
> >> psql -U "dbadmin" -d mydb -f D:\script.sql
> >>
> >> It was running well until I changed the user (to open a session)
> >> associated to these task.
> >> The script prompt for a password for user dbadmin.
> >>
> >> How to avoid that? I guess there is a config so dbadmin will "trust"
> this
> >> new user....
> >>
> >> Thanks for your help,
> >>
> >> Steve
> >
>
>
>
> --
> To understand recursion, one must first understand recursion.
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Irene Barg 2010-07-28 21:43:31 Re: postgresql-server-8.4.4-1PGDG.el5 - ERROR: could not write block 503414 of temporary file: No space le,ft on device
Previous Message raghu ram 2010-07-28 20:12:19 Pglesslog issue