暂无图片
pg中show 参数,怎么模糊查看或者show all|grep -i data这样怎么过滤需要的参数名
我来答
分享
暂无图片 匿名用户
pg中show 参数,怎么模糊查看或者show all|grep -i data这样怎么过滤需要的参数名

testdb@[local]:5432=#2651 show 'data%';
ERROR: syntax error at or near "'data%'"
LINE 1: show 'data%';
^
testdb@[local]:5432=#2651 show data_directory;
data_directory
----------------
/data/pgdata


show all|grep -i data 怎么过滤出来想要的参数?

我来答
添加附件
收藏
分享
问题补充
3条回答
默认
最新
李宏达

可以基于视图查询

select name from pg_settings where name like '%data%'
暂无图片 评论
暂无图片 有用 0
农夫三拳

[root@ usr]# psql -U postgres -c 'show all' |grep -i data_dir

data_directory | /var/lib/pgsql/14/data | Sets the server's data directory.
data_directory_mode | 0700 | Shows the mode of the data directory.


有密码的话就用-W指定密码,例如

 psql -U username -W password -c ‘show all’ | grep -i  data_dir

暂无图片 评论
暂无图片 有用 1
彭冲

这个问题可以用pg15的psql客户端\dconfig查看

暂无图片 评论
暂无图片 有用 0
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
暂无图片墨值悬赏