From: | Thomas Pundt <mlists(at)rp-online(dot)de> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org, "Michael =?utf-8?q?H=C3=B6ller?=" <MichaelHoeller(at)t-online(dot)de> |
Subject: | Re: postgres on the comman line |
Date: | 2005-09-22 14:13:10 |
Message-ID: | 200509221613.10501.mlists@rp-online.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Hi Michael,
On Thursday 22 September 2005 15:55, Michael Höller wrote:
| I like to automate a daily check and like to run select statement via
| cron but this seems to be more tricky than I thought....
|
| I tried the following:
| su postgres -c "select count(*) from TABLE where xxxxxx;"
you mean
su - postgres -c "echo 'select count(*) from TABLE where xxxxxx;'|psql"
?
| I have the probelm that I am allways asked for the password - I did not
| find a way how to pass the password.
search the documentation for the .pgpass file. It should contain lines
with colon separated values consisting of host:port:database:user:password
and must not be world-readable.
| Also I like to direct the result to a file, I assume I can do this via >
| but not haveing passed the first problem I did not check this.
yes.
Ciao,
Thomas
--
Thomas Pundt <thomas(dot)pundt(at)rp-online(dot)de> ---- http://rp-online.de/ ----
From | Date | Subject | |
---|---|---|---|
Next Message | A. Kretschmer | 2005-09-22 14:15:06 | Re: postgres on the comman line |
Previous Message | Michael Höller | 2005-09-22 13:55:53 | postgres on the comman line |