如何判断postgresql表是否存在
postgresql判断一个表是否存在:
方法一:
selectcount(*)frompg_classwhererelname='tablename';
方法二:
selectcount(*)frominformation_schema.tableswheretable_schema='public'andtable_type='BASETABLE'and table_name='tablename';
推荐学习《Python教程》。
本网站文章仅供交流学习 ,不作为商用, 版权归属原作者,部分文章推送时未能及时与原作者取得联系,若来源标注错误或侵犯到您的权益烦请告知,我们将立即删除.