当前位置:首页 > 云计算 > 正文内容

postgresql怎么判断表是否存在

2022-05-04 03:14:29云计算2

postgresql判断一个表是否存在:

方法一:

selectcount(*)frompg_classwhererelname='tablename';

方法二:

selectcount(*)frominformation_schema.tableswheretable_schema='public'andtable_type='BASETABLE'and
table_name='tablename';

推荐学习《python教程》。

本网站文章仅供交流学习 ,不作为商用, 版权归属原作者,部分文章推送时未能及时与原作者取得联系,若来源标注错误或侵犯到您的权益烦请告知,我们将立即删除.

本文链接:https://www.xibujisuan.cn/10199.html

标签: Python