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
版权声明:本文为博主原创文章,转载请附上博文链接!

猜你喜欢

转载自www.cnblogs.com/telwanggs/p/11201000.html
今日推荐