postgresql
licelice163
这个作者很懒,什么都没留下…
展开
-
Pg数据库导出表结构
SELECT a.attnum,a.attname AS field,t.typname AS type,a.attlen AS length,a .atttypmod AS lengthvar,a.attnotnull AS notnull,c.relnamefrom pg_class c,pg_attribute a,pg_type t where a.attnum>0 and a.att原创 2017-03-21 20:19:29 · 5597 阅读 · 0 评论 -
PG数据库查看索引使用情况
select relname, indexrelname, idx_scan, idx_tup_read, idx_tup_fetch from pg_stat_user_indexes order by idx_scan asc, idx_tup_read asc, idx_tup_fetch asc;select relname, indexrelna转载 2017-08-04 15:15:17 · 5441 阅读 · 0 评论 -
Pg数据库比较时间大小
postgresql 比较两个时间差大于 N个小时摘要: PG 中时间想减后为interval ,比较两个时间大于某个小时或者分钟等可以直接通过interval来实现 example1: – 判断两个时间差大于4个小时 select timestamp ‘2013-11-11 10:00:00’ - timestamp ‘2013-11-08 12:00:00’ > interval ‘4 h转载 2017-11-02 10:49:36 · 21091 阅读 · 0 评论