How to get a list column names and datatype of a table in PostgreSQL?

前端 未结 11 2258
[愿得一人]
[愿得一人] 2020-12-02 10:02

With the following query, we can get a list of column names and datatype of a table in PostgreSQL.

11条回答
  •  余生分开走
    2020-12-02 11:04

    SELECT column_name,data_type 
    FROM information_schema.columns 
    WHERE
    table_name = 'your_table_name' 
    AND table_catalog = 'your_database_name' 
    AND table_schema = 'your_schema_name';
    

提交回复
热议问题