PostgreSQL查看表、表索引、视图、表结构
2024-10-19 02:19:41
-- 表索引
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';
最新文章
- 【转】用C写一个简单病毒
- PHP遍历、删除文件夹中的所有文件
- TCSQL实时列表缓存数据库帮助文档
- 【Cocos2d入门教程二】Cocos2d-x基础篇
- Python抓取淘宝IP地址数据
- [Codeforces Round #296 div2 D] Clique Problem 【线段树+DP】
- Majority Element 解答
- 获取星座的JS函数
- Android进阶:六、在子线程中直接使用 Toast 及其原理
- Java学习笔记之——线程的生命周期、线程同步
- tomcat配置去掉项目名称
- Navicat 连接MySQL时出现1251错误的解决方案
- 《python for data analysis》第二章,美国1880-2010年出生人口姓名的数据分析
- SSM+MyBatis框架详解
- C# DGVPrinter.cs 打印方法
- java_oop_方法2
- 原生JS实现addClass,removeClass,toggleClass
- [剑指Offer]23-链表中环的入口节点
- Day14 自己定义泛型类的使用
- LightOJ 1030 - Discovering Gold - [概率DP]
热门文章
- Spring 事物Transaction
- gitlab 与 jenkins 关联
- angular 遍历foreach
- SSH Config 那些你所知道和不知道的事 (转)
- 处理 NCBI taxonomy tree
- GUI学习之七——单选框QRadioButton和QButtonGroup的学习总结
- [Hadoop]Hadoop章3 NameNode的ZKFC机制
- java--利用DecimalFormat.java类将给定的数字进行格式化
- 解决 ERROR: missing Change-Id in commit message footer 问题
- C#中get和set属性的作用