码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2014-08-13 01:05:14      阅读:370      评论:0      收藏:0      [点我收藏+]

标签:des   os   io   strong   for   ar   art   div   

[sql] view plaincopy
  1. 1、相当与mysql的show databases;  
[sql] view plaincopy
  1. select datname from pg_database;  


[sql] view plaincopy
  1. 2、相当于mysql的show tables;  
[sql] view plaincopy
  1. SELECT table_name FROM information_schema.tables WHERE table_schema = ‘public‘;  

public 是默认的schema的名字


[sql] view plaincopy
  1. 3、相当与mysql的describe table_name;  
[sql] view plaincopy
  1. SELECT column_name FROM information_schema.columns WHERE table_name =‘table_name‘;  
[sql] view plaincopy
    1. ‘table_name‘是要查询的表的名字 

postgresql的show databases、show tables、describe table操作,布布扣,bubuko.com

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

标签:des   os   io   strong   for   ar   art   div   

原文地址:http://www.cnblogs.com/iasd923/p/3909012.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!