Обсуждение: raise notice, psql and having some feedback from scripts

Поиск
Список
Период
Сортировка

raise notice, psql and having some feedback from scripts

От
Ivan Sergio Borgonovo
Дата:
I just have some batch work in scripts that I pass through:

psql < script.sql &>script.log &

or may be run by cron.

In sql raise notice is not available. Is there any other way to send
messages to the logs without polluting them too much with -a?

--
Ivan Sergio Borgonovo
http://www.webthatworks.it


Re: raise notice, psql and having some feedback from scripts

От
Sam Mason
Дата:
On Mon, Nov 03, 2008 at 03:14:14PM +0100, Ivan Sergio Borgonovo wrote:
> I just have some batch work in scripts that I pass through:
>
> psql < script.sql &>script.log &
>
> or may be run by cron.
>
> In sql raise notice is not available. Is there any other way to send
> messages to the logs without polluting them too much with -a?

You could write a pl/pgsql function that just does a RAISE NOTICE with
its argument.  As another aid, the output from psql tends to be better
if you use "-f script.sql" rather than piping the file in.


  Sam