Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hrjfz-00035y-7D for pgsql-general@arkaria.postgresql.org; Sun, 28 Jul 2019 13:57:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hrjfy-0001lE-0X for pgsql-general@arkaria.postgresql.org; Sun, 28 Jul 2019 13:57:26 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hrjfx-0001kd-Kc for pgsql-general@lists.postgresql.org; Sun, 28 Jul 2019 13:57:25 +0000 Received: from mout.kundenserver.de ([212.227.126.133]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1hrjfu-0007Dj-EG for pgsql-general@lists.postgresql.org; Sun, 28 Jul 2019 13:57:24 +0000 Received: from [127.0.0.1] ([62.117.25.147]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MysmQ-1iedIM2zWk-00vtD8; Sun, 28 Jul 2019 15:57:17 +0200 Subject: Re: logging "raise" to file To: wambacher@posteo.de, pgsql-general@lists.postgresql.org References: <0112e7a5-6dd4-2c86-418c-6a982cb8ba9b@posteo.de> From: "Georg H." Message-ID: Date: Sun, 28 Jul 2019 15:57:15 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <0112e7a5-6dd4-2c86-418c-6a982cb8ba9b@posteo.de> Content-Type: multipart/alternative; boundary="------------B8DE4A558BAEC10F3B3D2915" Content-Language: de-DE X-Provags-ID: V03:K1:EA3Q5R5+6VKE+ObfWwU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subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------B8DE4A558BAEC10F3B3D2915 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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 --------------B8DE4A558BAEC10F3B3D2915 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit

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

--------------B8DE4A558BAEC10F3B3D2915--