Re: chron scripts and pgsql - Mailing list pgsql-general

From Dennis Gearon
Subject Re: chron scripts and pgsql
Date
Msg-id 3E9196B4.9030808@cvc.net
Whole thread Raw
In response to Re: chron scripts and pgsql  (Ken Harris <kharris@lhinfo.com>)
List pgsql-general
Isn't the script execution id dynamic, i.e. changes everytime the script is run?
How do you also limit permissions to an execution id?

Ken Harris wrote:
> My instance of postgres runs on a separate box than the one that does the work.
> So connections are always via TCP/IP.  Therefore, the simple "psql -c
> <command>" doesn't work because my databases require a username/password.  My
> solution for the cron scripts (the only one I could figure out that works).  My
> database name and password are stored in a file readable only by the script
> execution id.  Those filenames and passwords are parsed and set to the PGUSER
> and PGPASSWORD variables (which exist only for the life of the script).  I can
> then run my "pgsql -h <hostname> -c <command>" for any and all databases.
>
> If anyone has a better solution for the username/password, I would love to see
> it, but this works.
>
> Hope this helps,
>


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: possible time change issue - known problem?
Next
From: "Dan Langille"
Date:
Subject: Re: possible time change issue - known problem?