Bruce Momjian wrote:




I don't see how listing the log files relates to editing the confuration
files.

Both are remote administration. While we've seen the discussion that one aspect (config file editing) should be performed in psql, you assume the other aspect (viewing the logfile) to be not interesting. Your argumentation doesn't seem consequent to me.

it would be something done in C or another application language.  Aren't
the file names already ordered based on their file names, given the
default pattern, postgresql-%Y-%m-%d_%H%M%S.log?

The issue is _filtering_, not ordering. Since the log directory might be directed to a different location, non-pgsql logfiles might be there too. You'd probably won't expect to retrieve these files over a pgsql connection.


Well, if they mix log files and non-log files in the same directory, we
would have to filter based on the log_filename directive in the
application, or use LIKE in a query.

.. which is what pg_logdir_ls does. And it's robust against filenames that don't have valid dates too; imagine postgresql-2005-01-01_crash1.log.

Regards,
Andreas



---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

              http://archives.postgresql.org

Reply via email to