加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

postgresql jdbc命令转换

发布时间:2020-12-13 17:02:26 所属栏目:百科 来源:网络整理
导读:http://www.linuxscrew.com/2009/07/03/postgresql-show-tables-show-databases-show-columns/ PostgreSQL is one of the best database engines for an average web project and many who moves to psql from mysql (for example) often ask the following

http://www.linuxscrew.com/2009/07/03/postgresql-show-tables-show-databases-show-columns/

PostgreSQLis one of the best database engines for an average web project and many who moves topsqlfrom mysql (for example) often ask the following questions: what is the analog of “show tables” in postgres? or how can I get the list of databases in postgres like “show databases” in mysql? The answers are short:

mysql:SHOW TABLES
postgresql:d
postgresql:SELECT table_name FROM information_schema.tables WHERE table_schema = 'public';

mysql:SHOW DATABASES
postgresql:l
postgresql:SELECT datname FROM pg_database;

SHOW COLUMNS
postgresql:dtable
postgresql:SELECT column_name FROM information_schema.columns WHERE table_name ='table';

DESCRIBE TABLE
postgresql:d+table
postgresql:SELECT column_name FROM information_schema.columns WHERE table_name ='table';

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读