数据仓库服务 GAUSSDB(DWS)-通用文件访问函数:pg_stat_file(filename text)

时间:2024-01-26 16:15:18

pg_stat_file(filename text)

描述:返回一个文本文件的状态信息。

返回值类型:record

备注:pg_stat_file返回一条记录,其中包含:文件大小、最后访问时间戳、最后更改时间戳、最后文件状态修改时间戳以及标识传入参数是否为目录的boolean值。典型的用法:

1
SELECT * FROM pg_stat_file('filename');
1
SELECT (pg_stat_file('filename')).modification;

示例:

1
2
3
4
5
6
7
8
9
SELECT * FROM pg_stat_file('postmaster.pid');
 
 size |         access         |      modification      |         change         
| creation | isdir 
------+------------------------+------------------------+------------------------
+----------+-------
  117 | 2017-06-05 11:06:34+08 | 2017-06-01 17:18:08+08 | 2017-06-01 17:18:08+08 
|          | f
(1 row)
1
2
3
4
5
SELECT (pg_stat_file('postmaster.pid')).modification;
      modification      
------------------------
 2017-06-01 17:18:08+08
(1 row)
support.huaweicloud.com/sqlreference-820-dws/dws_06_0054.html