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

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: raise notice, psql and having some feedback from scripts
Date: 2008-11-03 14:20:42
Message-ID: 20081103142041.GM2459@frubble.xen.chris-lamb.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2008-11-03 14:44:18 Re: Are there plans to add data compression feature to postgresql?
Previous Message Russ Brown 2008-11-03 14:18:15 Re: Performance of views