Re: [HACKERS] Patch to implement pg_current_logfile() function - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [HACKERS] Patch to implement pg_current_logfile() function
Date
Msg-id CAB7nPqQYHbrNSwf_3ge04MvaVHJNd4kmctkTztwgm0nSxefZgw@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Patch to implement pg_current_logfile() function  (Gilles Darold <gilles.darold@dalibo.com>)
List pgsql-hackers
On Wed, Jan 18, 2017 at 3:06 AM, Gilles Darold <gilles.darold@dalibo.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



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [HACKERS] increasing the default WAL segment size
Next
From: Michael Paquier
Date:
Subject: Re: [HACKERS] Patch to implement pg_current_logfile() function