当前位置:网站首页>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)
边栏推荐
- Dart code comments and documentation specification
- N32L43x Flash读\写\擦除操作总结
- VLAN实验
- C # learning notes ----- C # connect to MySQL database
- 喜欢听的歌曲
- Summary: Prometheus storage
- 【向 Dice Roller 应用添加图片】
- 使用Gateway的流式api修改请求路径
- 26. Abstraction and template ideas
- How tormenting are weekly and monthly reports? Universal report template recommended collection! (template attached)
猜你喜欢

Redis 5 种基本数据结构

路由策略简介

Zhi Huijun, Huawei's "genius youth", has made a new work, building a "customized" smart keyboard from scratch

Graph theory analysis of white matter brain function network: neural markers for classification and prediction of depression

Login function implementation

股票问题5连

docker 本地搭建mysql主从

Linux系统彻底删除Mysql

Flink 在 讯飞 AI 营销业务的实时数据分析实践

企业运维实践-使用Aliyun容器镜像服务对海外gcr、quay仓库镜像进行镜像拉取构建
随机推荐
Collection / container
Transplant QT system for i.mx6ull development board - cross compile QT code
Interview question 01.05. Primary editing
Docker builds MySQL master-slave locally
Lambda表达式和Stream流
Linux安装mysql8.0.29详细教程
Tencent cloud hiflow scene connector
华为“天才少年”稚晖君又出新作,从零开始造“客制化”智能键盘
负载均衡SLB
幸福的晚年
Leetcode: 515. Find the maximum value in each tree row
VPP之DPDK插件
"Do you" want to be a test / development programmer? We strive to sprout
股票问题5连
Leetcode 2347. the best poker hand
面试题 01.08. 零矩阵
Prediction of charitable donation behavior by EEG multivariate model analysis
软件测试面试题:如何准备测试数据?如何防止数据污染?
路由策略简介
VLAN experiment