Re: postgres on the comman line

Поиск
Список
Период
Сортировка
От A. Kretschmer
Тема Re: postgres on the comman line
Дата
Msg-id 20050922141506.GE12957@webserv.wug-glas.de
обсуждение исходный текст
Ответ на postgres on the comman line  ("Michael Höller" <MichaelHoeller@t-online.de>)
Список pgsql-sql
am  22.09.2005, um 15:55:53 +0200 mailte "Michael Höller" folgendes:
> 
> 
> Hello,
> 
> 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;"

- run the cron direcly as postgres
- echo "select foo from bar" | psql ...


or:

write your sql-query i a file and "psql -f file"

> 
> I have the probelm that I am allways asked for the password - I did not
> find a way how to pass the password. 

put it in the ~/.psqlrc


> 
> Also I like to direct the result to a file, I assume I can do this via >

yes, this is possible.


Regards, Andreas
-- 
Andreas Kretschmer    (Kontakt: siehe Header)
Heynitz:  035242/47212,      D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net===    Schollglas Unternehmensgruppe    === 


В списке pgsql-sql по дате отправления:

Предыдущее
От: Thomas Pundt
Дата:
Сообщение: Re: postgres on the comman line
Следующее
От: Achilleus Mantzios
Дата:
Сообщение: Re: postgres on the comman line