Re: Patch to implement pg_current_logfile() function

Поиск
Список
Период
Сортировка
Искать
От
Gilles Darold
Тема
Re: Patch to implement pg_current_logfile() function
Дата
Msg-id
109c0305-16b8-a8fd-60a6-76633ffa6237@dalibo.com
Ответ на
Список
Дерево обсуждения
Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: Patch to implement pg_current_logfile() function Vik Fearing <vik@2ndquadrant.fr>
Re: Patch to implement pg_current_logfile() function Tom Lane <tgl@sss.pgh.pa.us>
Re: Patch to implement pg_current_logfile() function Robert Haas <robertmhaas@gmail.com>
Re: Patch to implement pg_current_logfile() function Tom Lane <tgl@sss.pgh.pa.us>
Re: Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: Patch to implement pg_current_logfile() function Tom Lane <tgl@sss.pgh.pa.us>
Re: Patch to implement pg_current_logfile() function "Shulgin, Oleksandr" <oleksandr.shulgin@zalando.de>
Re: Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: Patch to implement pg_current_logfile() function Tom Lane <tgl@sss.pgh.pa.us>
Re: Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: Patch to implement pg_current_logfile() function Michael Paquier <michael.paquier@gmail.com>
Re: Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function Michael Paquier <michael.paquier@gmail.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function Christoph Berg <myon@debian.org>
Re: Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: Patch to implement pg_current_logfile() function Christoph Berg <myon@debian.org>
Re: Patch to implement pg_current_logfile() function Christoph Berg <myon@debian.org>
Re: Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: Patch to implement pg_current_logfile() function Christoph Berg <myon@debian.org>
Re: Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function Christoph Berg <myon@debian.org>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function Christoph Berg <myon@debian.org>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: Patch to implement pg_current_logfile() function Robert Haas <robertmhaas@gmail.com>
Re: Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function Robert Haas <robertmhaas@gmail.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function Tom Lane <tgl@sss.pgh.pa.us>
Re: Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function Robert Haas <robertmhaas@gmail.com>
Re: Patch to implement pg_current_logfile() function Tom Lane <tgl@sss.pgh.pa.us>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: Patch to implement pg_current_logfile() function Robert Haas <robertmhaas@gmail.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function Robert Haas <robertmhaas@gmail.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function Alvaro Herrera <alvherre@2ndquadrant.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function Robert Haas <robertmhaas@gmail.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function Alvaro Herrera <alvherre@2ndquadrant.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function Michael Paquier <michael.paquier@gmail.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function Kevin Grittner <kgrittn@gmail.com>
Re: [HACKERS] Patch to implement pg_current_logfile() function Michael Paquier <michael.paquier@gmail.com>
Re: Patch to implement pg_current_logfile() function Tom Lane <tgl@sss.pgh.pa.us>
Re: Patch to implement pg_current_logfile() function Haribabu Kommi <kommi.haribabu@gmail.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Re: Patch to implement pg_current_logfile() function Robert Haas <robertmhaas@gmail.com>
Re: Patch to implement pg_current_logfile() function Gilles Darold <gilles.darold@dalibo.com>
Re: Patch to implement pg_current_logfile() function "Karl O. Pinc" <kop@meme.com>
Le 14/10/2016 à 20:45, Christoph Berg a écrit :
> Re: Gilles Darold 2016-10-14 
>> Agree, the usability of the current version is really a pain. What I've
>> thought is that the function could return the csv log in all case when
>> csvlog is set in log_destination and the stderr log file when csvlog is
>> not defined. We can also have a parametrer to ask for a specific log
>> format, like pg_current_logfile('csv') or pg_current_logfile('stderr').
> Good idea to add an optional parameter.
>
> pg_current_logfile(type text DEFAULT 'auto')
>
> pg_current_logfile()
> pg_current_logfile('stderr')
> pg_current_logfile('csvlog')
> pg_current_logfile('auto')
>
> I think I'd prefer the stderr variant by default when both variants
> are configured.
>
> Christoph
>
>

Here is the v6 of the patch, here is the description of the
pg_current_logfile() function, I have tried to keep thing as simple as
possible:

pg_current_logfile( [ destination text ] )
-----------------------------------------------------

Returns the name of the current log file used by the logging collector,
as text.
Log collection must be active or the return value is undefined. When
csvlog is
used as log destination, the csv filename is returned, when it is set to
stderr,
the stderr filename is returned. When both are used, it returns the
stderr filename.

There is an optional parameter of type text to determines the log
filename to
return following the log format, values can be 'csvlog' or 'stderr'.
When the log
format asked is not used as log destination then the return value is
undefined.

Example of use when log_destination = 'csvlog,stderr'

postgres=# select pg_current_logfile();
           pg_current_logfile           
-----------------------------------------
 pg_log/postgresql-2016-10-18_121326.log
(1 row)

postgres=# select pg_current_logfile('csvlog');

           pg_current_logfile           
-----------------------------------------
 pg_log/postgresql-2016-10-18_121326.csv
(1 row)

postgres=# select pg_current_logfile('stderr');
           pg_current_logfile           
-----------------------------------------
 pg_log/postgresql-2016-10-18_121326.log
(1 row)

postgres=# select pg_current_logfile('csv');
ERROR:  log format csv not supported, possible values are stderr or csvlog

postgres=# select pg_read_file(pg_current_logfile());
                                          
pg_read_file                                           
---------------------------------------------------------------------------------------------------
 2016-10-18 14:06:30.576 CEST [8113] ERROR:  invalid input syntax for
integer: "A" at character 10+
 2016-10-18 14:06:30.576 CEST [8113] STATEMENT:  select
1='A';                                    +
 
(1 row)

I've also fixed the crash when current_logfile is removed by hand.


-- 
Gilles Darold
Consultant PostgreSQL
http://dalibo.com - http://dalibo.org

В списке pgsql-hackers по дате отправления
От: Amit Kapila
Дата:
Сообщение: Re: Parallel Index Scans
От: Michael Paquier
Дата:
FAQ