你的位置:首页 > 信息动态 > 新闻中心
信息动态
联系我们

【pg】查表是否存在

2022/8/19 5:58:20

【PG SQL】

一行流方式:

select count(*) from information_schema.table where table_schema='your schema' and table_type='BASE TABLE' and upper(table_name)=upper('your tableName')

层次化方式:

select count(*) 
from information_schema.table 
where 
table_schema='your schema' and 
table_type='BASE TABLE' and 
upper(table_name)=upper('your tableName')

END