牛骨文教育服务平台(让学习变的简单)
博文笔记

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

创建时间:2014-08-12 投稿人: 浏览次数:3611
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"是要查询的表的名字

声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。