PostgreSQL查询系统信息 4年前

整理一下,一方面备用,一方面分享

  1. 查询数据表信息

    可通过 information_schema.tablespg_tables

    select tbs.* from pg_tables tbs where tablename  = 'tablename';
    
     select * from information_schema.tables where table_schema='public' and table_name='tablename';
    
  2. 查询表中的字段信息

    通过 from information_schema.columns

    select * from information_schema.columns where table_schema='public' and table_name='tablename';
    

参考链接:hzxPeter nwpu053871

image
寒炎
你只见树,未见森林
2
发布数
1
关注者
911
累计阅读

热门教程文档

10.x
88小节
Djiango
17小节
Spring Boot
24小节
Docker
62小节
MyBatis
19小节
广告