Re: Patch to implement pg_current_logfile() function

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Gilles Darold <gilles(dot)darold(at)dalibo(dot)com>
Cc: "Karl O(dot) Pinc" <kop(at)meme(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch to implement pg_current_logfile() function
Date: 2017-01-18 02:06:14
Message-ID: CAB7nPqQYHbrNSwf_3ge04MvaVHJNd4kmctkTztwgm0nSxefZgw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 18, 2017 at 3:06 AM, Gilles Darold <gilles(dot)darold(at)dalibo(dot)com> wrote:
> This have already been discuted previously in this thread, one of my
> previous patch version has implemented this behavior but we decide that
> what we really want is to be able to use the function using the
> following simple query:
>
> SELECT pg_read_file(pg_current_logfiles());
>
> and not something like
>
> SELECT pg_read_file(SELECT file FROM pg_current_logfiles() LIMIT 1);
> or
> SELECT pg_read_file(SELECT file FROM pg_current_logfiles() WHERE
> method='stderr');
>
> You can also obtain the "kind" of output from the SRF function using:
>
> SELECT pg_read_file('current_logfiles');

I don't really understand this argument as you can do that as well:
SELECT pg_read_file(file) FROM pg_current_logfiles WHERE method = 'stderr';

> I'm not against adding a warning or error message here even if it may
> never occurs, but we need a new error code as it seems to me that no
> actual error code can be used.

ERRCODE_INTERNAL_ERROR, no?
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2017-01-18 02:08:25 Re: Patch to implement pg_current_logfile() function
Previous Message Michael Paquier 2017-01-18 01:54:36 Re: increasing the default WAL segment size