常用脚本_PostgreSQL常用命令

su - postgres
 cd /usr/local/pgsql/bin/

./psql

SHOW port;
\l 
\c dbname
\d 
\d  tablename
\d+  tablename
SELECT pg_is_in_recovery();
SELECT count(*) FROM pg_stat_replication;
SELECT * FROM pg_stat_replication;
CREATE DATABASE cdt_pg_maxkb;
CREATE USER pgmaxkb_owner WITH PASSWORD '「password」';
GRANT ALL PRIVILEGES ON DATABASE cdt_pg_maxkb TO pgmaxkb_owner;
select * from pg_stat_activity
>> Home

51ak

2024/11/07

Categories: 常用脚本 Tags: 基础

《数据库工作笔记》公众号
扫描上面的二维码,关注我的《数据库工作笔记》公众号