postgresql判断表有没有存在的方法

  介绍

小编给大家分享一下postgresql判断表有没有存在的方法,希望大家阅读完这篇文章后大所收获、下面让我们一起去探讨吧!

<强> postgresql判断一个表是否存在:

方法一:

select  count(*),得到pg_class  where  relname =, & # 39;表# 39;;

方法二:

select  count(*),得到information_schema.tables  where  table_schema=& # 39;公共# 39;,以及table_type=& # 39; BASE 表# 39;,以及   table_name=& # 39;表# 39;;

看完了这篇文章,相信你对postgresql判断表有没有存在的方法有了一定的了解,想了解更多相关知识,欢迎关注行业资讯频道,感谢各位的阅读!

postgresql判断表有没有存在的方法