当前位置:网站首页>GBase 8c 通用文件访问函数
GBase 8c 通用文件访问函数
2022-07-27 23:56:00 【大壮十二】
通用文件访问函数提供了对数据库服务器上的文件的本地访问接口。只有GBase 8c目录和log_directory目录里面的文件可以访问。使用相对路径访问GBase 8c目录里面的文件,以及匹配log_directory配置而设置的路径访问日志文件。只有数据库初始化用户才能使用这些函数。
pg_ls_dir(dirname text)
描述:列出目录中的文件。
返回值类型:setof text
备注:pg_ls_dir返回指定目录里面的除了特殊项“.”和“..”之外所有名称。
示例:
gbase=# SELECT pg_ls_dir('./');
pg_ls_dir
----------------------
global
pg_xlog
pg_clog
pg_csnlog
pg_notify
pg_serial
pg_snapshots
pg_twophase
pg_multixact
base
pg_replslot
pg_tblspc
pg_stat_tmp
pg_llog
pg_errorinfo
undo
pg_logical
pg_location
PG_VERSION
pg_ctl.lock
postgresql.conf.lock
postmaster.pid.lock
mot.conf
gs_gazelle.conf
pg_hba.conf
pg_ident.conf
postgresql.conf.bak
server.crt
server.key
cacert.pem
server.key.cipher
server.key.rand
pg_hba.conf.lock
pg_hba.conf.bak
gaussdb.state
postmaster.opts
gswlm_userinfo.cfg
postgresql.conf
postmaster.pid
(39 rows)
pg_read_file(filename text, offset bigint, length bigint)
描述:返回一个文本文件的内容。
返回值类型:text
备注:pg_read_file返回一个文本文件的一部分,从offset开始,最多返回length字节(如果先达到文件结尾,则小于这个数值)。如果offset是负数,则它是相对于文件结尾回退的长度。如果省略了offset和length,则返回整个文件。
示例:
gbase=# SELECT pg_read_file('postmaster.pid',0,100);
pg_read_file
-------------------------------------------
7961 +
/home/gbase/project/install/data/dn/dn1_1+
1651723153 +
20008 +
/home/gbase/gbase8c/tmp +
[local_ip] +
2
(1 row)
边栏推荐
猜你喜欢

VLAN实验

现货白银如何计算盈亏

Load balancing SLB

【向 Dice Roller 应用添加图片】

股票问题5连

unreal ue4.27 switchboard 移植出引擎流程

Baidu PaddlePaddle easydl: when AI enters the factory, "small bearing" can also turn "big industry"

负载均衡SLB

If you are still using WiFi, you will be out: li-fi is better!!!

Data warehouse construction - DWS floor
随机推荐
C#学习笔记----C#连接MySQL数据库
[add pictures to dice roller app]
Hcip day 15
“你“想当测试/开发程序员吗?努力发芽的我们......
"Wei Lai Cup" 2022 Niuke summer multi school training camp 3 supplementary problem solution (a, C, J)
软件测试面试题:如何发现数据库的相关问题?
VPP之DPDK插件
String
BGP联邦实验
leetcode: 515. 在每个树行中找最大值
牛客网刷题训练(三)
qt 设置图标
幸福的晚年
LeetCode 2347. 最好的扑克手牌
还在用WIFI你就OUT了:LI-FI更牛!!!
阿门的故事
自定义事件
For newly installed PIP3, use no module named 'LSB_ Release 'problem
Oracle Rac 集群文件目录迁移
Qt 绘制系统简介