Re: logfile subprocess and Fancy File Functions - Mailing list pgsql-patches

From Andreas Pflug
Subject Re: logfile subprocess and Fancy File Functions
Date
Msg-id 40FF77EA.8040803@pse-consulting.de
Whole thread Raw
In response to Re: logfile subprocess and Fancy File Functions  (Bruce Momjian <pgman@candle.pha.pa.us>)
List 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.

pgsql-patches by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: win32 readline
Next
From: "Magnus Hagander"
Date:
Subject: Re: win32 readline