Re: [HACKERS] For review: Server instrumentation patch
От | Andreas Pflug |
---|---|
Тема | Re: [HACKERS] For review: Server instrumentation patch |
Дата | |
Msg-id | 42FDA9B8.4070702@pse-consulting.de обсуждение исходный текст |
Ответ на | Re: [HACKERS] For review: Server instrumentation patch (Bruce Momjian <pgman@candle.pha.pa.us>) |
Список | pgsql-patches |
Bruce Momjian wrote: > > True, but that is more for the application. I don't imagine a user > looking at that from psql would have a problem. > > However, you asked for a query that looks like pg_ls_logdir() and here > it is: > > SELECT pg_ls_dir > FROM ( > SELECT pg_ls_dir(t1.setting) > FROM (SELECT setting FROM pg_settings WHERE NAME = 'log_directory') AS t1 > ) AS t2, > (SELECT setting FROM pg_settings WHERE NAME = 'log_filename') AS t3 > WHERE t2.pg_ls_dir LIKE regexp_replace(t3.setting, '%.*', '') || '%'; > > The one thing it doesn't do, as you mentioned, is check for valid dates, > but it is certainly more flexible than embedding something in the backend. The interesting part of pg_logdir_ls is the filetime, to enable SELECT pg_file_unlink(filename) FROM pg_logdir_ls() WHERE filetime < now() - '30 days'::interval Regards, Andreas
В списке pgsql-patches по дате отправления: