Re: logfile subprocess and Fancy File Functions

From: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
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-22 08:16:42
Message-ID: 40FF77EA.8040803@pse-consulting.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Bruce Momjian wrote:

>
>
> Here is what you can do:
>
> SELECT filename,
> (SELECT file_len FROM pg_file_stat(filename)),
> (SELECT file_ctime FROM pg_file_stat(filename)),
> (SELECT file_mtime FROM pg_file_stat(filename)),
> (SELECT file_atime FROM pg_file_stat(filename))
> FROM pg_dir_ls('/etc') AS d (filename text...)
> WHERE filename like 's%'

Not really satisfying (pg_file_stat is volatile) but subselects give the
desired result.

>
> Are we done? Seems pg_file_stat() works fine. Do we need other
> adjustments?

The only single spot where performance could be improved is in
pg_file_stat, where attinmeta is created again and again; this may be
cached in a static memory context instead.

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Magnus Hagander 2004-07-22 08:45:51 Re: win32 readline
Previous Message Simon Riggs 2004-07-22 07:43:18 Re: [HACKERS] Point in Time Recovery