logging "raise" to file

Started by Nonameover 6 years ago4 messagesgeneral
Jump to latest
#1Noname
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

--
My projects:

Admin Boundaries of the World <https://wambachers-osm.website/boundaries&gt;
Missing Boundaries
<https://wambachers-osm.website/index.php/projekte/internationale-administrative-grenzen/missing-boundaries&gt;
Emergency Map <https://wambachers-osm.website/emergency&gt;
Postal Code Map (Germany only) <https://wambachers-osm.website/plz&gt;
Fools (QA for zipcodes in Germany) <https://wambachers-osm.website/fools&gt;
Postcode Boundaries of Germany <https://wambachers-osm.website/pcoundaries&gt;
OSM Software Watchlist
<https://wambachers-osm.website/index.php/osm-software-watchlist&gt;

#2Guillaume Lelarge
guillaume@lelarge.info
In reply to: Noname (#1)
Re: logging "raise" to file

Hi,

Le dim. 28 juil. 2019 à 12:32, <wambacher@posteo.de> a écrit :

Hi,

is there a way to log output from "raise ..." to a local file? \o file
does not work (for me).

No, RAISE messages can only go to log files. You would need to call a
function that could write to a file (though without calling RAISE).

--
Guillaume.

#3Georg H.
georg-h@silentrunner.de
In reply to: Noname (#1)
Re: logging "raise" to file

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-transaction

regards

Georg

#4Noname
wambacher@posteo.de
In reply to: Georg H. (#3)
Re: logging "raise" to file

Thank Georg,

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*

--

My projects:

Admin Boundaries of the World <https://wambachers-osm.website/boundaries&gt;
Missing Boundaries
<https://wambachers-osm.website/index.php/projekte/internationale-administrative-grenzen/missing-boundaries&gt;
Emergency Map <https://wambachers-osm.website/emergency&gt;
Postal Code Map (Germany only) <https://wambachers-osm.website/plz&gt;
Fools (QA for zipcodes in Germany) <https://wambachers-osm.website/fools&gt;
Postcode Boundaries of Germany <https://wambachers-osm.website/pcoundaries&gt;
OSM Software Watchlist
<https://wambachers-osm.website/index.php/osm-software-watchlist&gt;