PostgreSQL查看表表索引视图表结构以及参数设置
Posted small_lei_it
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PostgreSQL查看表表索引视图表结构以及参数设置相关的知识,希望对你有一定的参考价值。
-- 表索引
select * from pg_indexes where tablename=‘person_wechat_label‘;
select * from pg_statio_all_indexes where relname=‘person_wechat_label‘;
-- 所有表
SELECT * FROM pg_tables;
-- 所有视图
SELECT * FROM pg_views;
-- 表结构
SELECT a.attnum,a.attname AS field,t.typname AS type,a.attlen AS length,a.atttypmod AS lengthvar,a.attnotnull AS notnull,b.description AS comment FROM pg_class c,pg_attribute a LEFT OUTER JOIN pg_description b ON a.attrelid=b.objoid AND a.attnum = b.objsubid,pg_type t WHERE c.relname = ‘person_wechat_label‘ and a.attnum > 0 and a.attrelid = c.oid and a.atttypid = t.oid ORDER BY a.attnum;
参数设置:https://yq.aliyun.com/articles/697710
从数据库中导出数据到文件:copy (select * from "user") to ‘/tmp/1.txt‘;
以上是关于PostgreSQL查看表表索引视图表结构以及参数设置的主要内容,如果未能解决你的问题,请参考以下文章