select * from pg_tables" select pg_size_pretty(pg_relation_size('t_inventory_product')); // 查看空间大小 select A.relname,B.reltuples from pg_stat_user_tables A,pg_class B where A.relname=B.relname order by B.reltuples DESC-- 查询用户所建的表及其表中记录数(非精确值,取决于vacuum的频率,但用于分析足够精度了)
时间查询
$where .= " AND TO_CHAR(time,'YYYY-MM-DD')>='" . $findfromdate . "' AND TO_CHAR(time,'YYYY-MM-DD')<='" . $findtodate . "'";