postgresql判断一个表是否存在:
方法一:
<a href="https://www.gaodaima.com/tag/select" title="查看更多关于select的文章" target="_blank">select</a> <a href="https://www.gaodaima.com/tag/count" title="查看更多关于count的文章" target="_blank">count</a>(*) from pg_class where relname = 'tablename';
www#gaodaima.com来源[email protected]搞@^&代*@码网搞代码
方法二:
select count(*) from information_schema.tables where table_schema='public' and table_type='BASE TABLE' and table_name='tablename';
Python学习网,大量的免费PostgreSQL入门教程,欢迎在线学习!
来源:搞代码网:原文地址:https://www.gaodaima.com