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

SELECT
    column_name,
    data_type
FROM
    information_schema.columns
WHERE
    table_name="table_name";

with the above query you can columns and its datatype

Leave a Comment