pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Georg H. <georg-h@silentrunner.de>
To: wambacher@posteo.de
To: pgsql-general@lists.postgresql.org
Subject: Re: logging "raise" to file
Date: Sun, 28 Jul 2019 15:57:15 +0200
Message-ID: <cb122917-a26e-9c76-b6f3-3c807e96bded@silentrunner.de> (raw)
In-Reply-To: <0112e7a5-6dd4-2c86-418c-6a982cb8ba9b@posteo.de>
References: <0112e7a5-6dd4-2c86-418c-6a982cb8ba9b@posteo.de>

Hi,

Am 28.07.2019 um 12:32 schrieb wambacher@posteo.de:
>
> Hi,
>
> is there a way to log output from "raise ..." to a local file? \o file 
> does not work (for me).
>
> regards
> walter
>

the red part writes your "raise notice" to your log

psql (+your connection string) -f /path/to/file.sql *> 
/path/to/log/xxx.log 2>&1*

see

https://dba.stackexchange.com/questions/107199/how-to-log-custom-messages-from-inside-a-postgresql-t...

regards

Georg

view thread (4+ messages)  latest in thread

Message-ID: <cb122917-a26e-9c76-b6f3-3c807e96bded@silentrunner.de>
Permalink:  ../cb122917-a26e-9c76-b6f3-3c807e96bded@silentrunner.de/
Also on:    postgresql.org/message-id/cb122917-a26e-9c76-b6f3-3c807e96bded@silentrunner.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: georg-h@silentrunner.de, wambacher@posteo.de
  Subject: Re: logging "raise" to file
  In-Reply-To: <cb122917-a26e-9c76-b6f3-3c807e96bded@silentrunner.de>
  References: <0112e7a5-6dd4-2c86-418c-6a982cb8ba9b@posteo.de> <cb122917-a26e-9c76-b6f3-3c807e96bded@silentrunner.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox