playboy=> \dt //相当于mysql的,mysql> show tables;
List of relations Schema | Name | Type | Owner
--------+------+-------+--------- public | test | table | playboy
(1 row)
playboy=> \di //相当于mysql的,mysql> show index from test;
List of relations
Schema | Name | Type | Owner | Table
--------+---------------+-------+---------+-------
public | playboy_id_pk | index | playboy | test
(1 row)
playboy=> select pg_size_pretty(pg_relation_size('playboy_id_pk')); //查看索大小
pg_size_pretty
----------------
8192 bytes
(1 row)
查看数据库playboy=> \l //\加上字母l,相当于mysql的,mysql> show databases; List of databases Name | Owner | Encoding -----------+----------+---------- playboy | postg