实现的功能类似MySQL:

show tables;

在 PostgreSQL 中需要写:

select * from pg_tables where schemaname = 'public';

返回结果类似如下:

schemaname | tablename | tableowner | tablespace | hasindexes | hasrules | hastriggers | rowsecurity 
------------+-----------+------------+------------+------------+----------+-------------+-------------
 public     | deploy    | postgres   |            | t          | f        | f           | f
 public     | deploy2   | postgres   |            | f          | f        | f           | f
(2 rows)

 

Logo

快速构建 Web 应用程序

更多推荐