Re: [HACKERS] For review: Server instrumentation patch

From: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>, Dave Page <dpage(at)vale-housing(dot)co(dot)uk>
Subject: Re: [HACKERS] For review: Server instrumentation patch
Date: 2005-08-12 22:06:16
Message-ID: 42FD1D58.8010104@pse-consulting.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Bruce Momjian wrote:

>> BTW, it surprised me that one of the functions (don't remember
>> which one) expected the log files to be named in a very specific
>> fashion. So there's no flexibility for changing the log_prefix.
>> Probably it's not so bad, but strange anyway. Is this for
>> "security" reasons?

The logger subprocess patch originally didn't allow changing the the
logfile name pattern, to make sure it can be interpreted safely at a
later time. There's simply no way to mark the file with a timestamp
without the risk of it being arbitrarily modified by file commands, thus
screwing up the order of logfiles. Later, there was the request to
alternatively append a timestamp instead of a date pattern, to use
apache logging tools that will probably access the logfiles directly
anyway. This ended up in the log_filename GUC variable.

>
> Righ, pg_logdir_ls() was the function. My feeling is that the
> application has access to the log_directory and log_filename values
> and can better and move flexibly filter pg_ls_dir() on the client end
> than we can do on the server. It just seemed like something that we
> better done outside the server.

Outside the server means pure SQL, if you don't want to drop psql as
client. So how would your query to display all all available _logfiles_
look like? You'd need to check for a valid date, besides interpreting
pg_strfime's patterns. Doesn't sound exactly like fun, but I'm keen to
see how your equivalent to

SELECT *, pg_file_length(filename) AS len
FROM pg_logdir_ls

looks like.

Regards,
Andreas

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Mark Wong 2005-08-12 22:16:04 Re: [HACKERS] Autovacuum loose ends
Previous Message Alvaro Herrera 2005-08-12 21:49:41 Re: [HACKERS] Autovacuum loose ends