软件下载吧文章资讯

分类分类

PostgreSQL 查找当前数据库的所有表操作

2024-03-08 08:50作者:下载吧

实现的功能类似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)

展开全部

相关文章

说两句网友评论
    我要跟贴
    取消