pg_stat_file() and length/size

Started by Bruce Momjianover 20 years ago2 messageshackers
Jump to latest
#1Bruce Momjian
bruce@momjian.us

I am thinking the proper term for the first column of pg_stat_file() is
"size", not "length".

test=> select * from pg_stat_file('.');
length | atime | mtime | ctime | isdir
--------+------------------------+------------------------+------------------------+-------

512 | 2005-08-13 23:06:38-04 | 2005-08-13 23:06:54-04 | 2005-08-13 23:06:54-04 | t
(1 row)

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#2Bruce Momjian
bruce@momjian.us
In reply to: Bruce Momjian (#1)
Re: [HACKERS] pg_stat_file() and length/size

Bruce Momjian wrote:

I am thinking the proper term for the first column of pg_stat_file() is
"size", not "length".

test=> select * from pg_stat_file('.');
length | atime | mtime | ctime | isdir
--------+------------------------+------------------------+------------------------+-------

512 | 2005-08-13 23:06:38-04 | 2005-08-13 23:06:54-04 | 2005-08-13 23:06:54-04 | t
(1 row)

I have renamed the column from length to size. I also renamed the
timestamp columns to be more meaningful:

test=> select (pg_stat_file('.')).*;
size | access | modification | change | creation | isdir
------+------------------------+------------------------+------------------------+----------+-------
512 | 2005-08-15 18:10:10-04 | 2005-08-15 17:30:28-04 | 2005-08-15 17:30:28-04 | | t
(1 row)

(Anyone have a better name for "change"?)

In doing this I also realized the ctime on Unix is change time (file
contents or inode), while on Win32 ctime is file creation time. I split
the ctime column into "change" and "creation", and one is null on each
platform. Above is the Unix output. I have also updated the catalog
version.

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

Attachments:

/bjm/difftext/plainDownload+47-40