PostgreSQL判断一个表是否存在


postgresql判断一个表是否存在:

方法一:

select count(*) from pg_class where relname = 'tablename';

 

方法二:

select count(*) from information_schema.tables where table_schema='public' and table_type='BASE TABLE' and table_name='tablename';
---------------------
作者:野狼枫
来源:CSDN
原文:https://blog.csdn.net/leixiaorong/article/details/7735883
版权声明:本文为博主原创文章,转载请附上博文链接!


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM