Search Postgresql Archives

Re: How to get previous log file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/28/20 2:42 AM, Andrus wrote:
Hi!

select pg_read_file(pg_current_logfile())
retrieves today log file.
Log files are in log directory:

/var/lib/postgresql/12/main/log# ls
...
postgresql-2020-06-08_000000.log  postgresql-2020-06-18_000000.log postgresql-2020-06-28_000000.log
postgresql-2020-06-09_000000.log  postgresql-2020-06-19_000000.log

How get yesterday log file from remote client application using postgresql query ?
Using Postgres 12 in Debian.

You where half way there:

https://www.postgresql.org/docs/12/functions-admin.html

pg_ls_dir() -- To get file names.

pg_read_file() -- Using file name from above.


Andrus.





--
Adrian Klaver
adrian.klaver@xxxxxxxxxxx





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux