Re: logfile subprocess and Fancy File Functions

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: logfile subprocess and Fancy File Functions
Date: 2004-07-21 03:07:19
Message-ID: 200407210307.i6L37Jb13556@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Andreas Pflug wrote:
> Before the thread concentrates too much on a decent default value, I'm
> posting a fresh version of the patch, for some more discussion. Current
> default for pg_logfile_prefix is 'postgresql-', may the committers
> decide which name is The Perfect One.
>
> All previous suggestions have been included, (nb: abstimein is not
> usable, because it ereports(ERROR) on failure; we want to skip wrong
> files gracefully, so I'm using ParseDateTime and DecodeDateTime instead).
>
> I'd still need feedback on pg_dir_ls: should it merely return a setof
> text, or should I enrich it to a record returning all stat data? After
> spending another thought on it, I believe the more sql-like approach is
> to deliver a full-featured record which is selected for the desired
> data, not adding columns with functions.

OK, new idea. Forget about modifying pg_dir_ls(). Instead add
pg_file_stat the returns the file size, times. You can then easily use
that for file size and times. Also, if you want, add an is_dir boolean
so people can write functions that walk the directory tree.

I noticed we had a big logging discussion during 7.4 beta about logging
and log rotation. This patch is clearly superior to the ideas we had at
that time.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2004-07-21 03:08:09 Re: Borland c++ compile problems...
Previous Message Bruce Momjian 2004-07-21 02:59:45 Re: Patch for pg_dump: Multiple -t options and new -T option