postgresql的show databases、show tables、describe table操作


1、相當與mysql的show databases;
select datname from pg_database;


2、相當於mysql的show tables;
SELECT table_name FROM information_schema.tables WHERE table_schema = 'public';
public 是默認的schema的名字


3、相當與mysql的describe table_name;
SELECT column_name FROM information_schema.columns WHERE table_name ='table_name';
'table_name'是要查詢的表的名字


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM