PostgreSQL判断一个表是否存在

时间:2023-03-09 03:21:42
PostgreSQL判断一个表是否存在

postgresql判断一个表是否存在:

方法一:

select count(*) from pg_class where relname = 'tablename';

方法二:

select count(*) from information_schema.tables where table_schema='public' and table_type='BASE TABLE' and table_name='tablename';
---------------------
作者:野狼枫
来源:CSDN
原文:https://blog.csdn.net/leixiaorong/article/details/7735883
版权声明:本文为博主原创文章,转载请附上博文链接!