如何判断postgresql表是否存在

图片[1]-如何判断postgresql表是否存在-uusu优素-乐高,模型,3d打印,编程

postgresql判断一个表是否存在:

方法一:

selectcount(*)frompg_classwhererelname='tablename';

方法二:

selectcount(*)frominformation_schema.tableswheretable_schema='public'andtable_type='BASETABLE'and
table_name='tablename';
原文来自:https://www.py.cn
© 版权声明
THE END
喜欢就支持一下吧
点赞14 分享