postgresql常用指令(待补充。。。)

-- 查看pg设置的最大连接数
show max_connections;

-- 查看当前连接数
select count(*) from pg_stat_activity;

-- 查看所有复制槽
select * from pg_replication_slots;

-- 删除某一复制槽 {your_slot_name}替换为要删除的复制槽名称
select pg_drop_replication_slot('{your_slot_name}');

-- 查询jsonb下一级字段
select jsonb->> 'fild1' from {your_schema}.{your_table};

-- 查询jsonb下一级的下一级(以此类推)
select jsonb -> 'metadata' ->> 'createdBy' from {your_schema}.{your_table};

-- 查询某一列的和
SELECT SUM(volume) AS totalCkoItems, SUM(person_times) AS totalCkoPeople
FROM {your_schema}.{your_table};

-- 建立索引(其实索引有很多种,值得拎出来单讲)
create index haiheng_uid_insert_fail_error_code_idx
    on {your_table} (error_code);


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值