sql 列出PostgreSQL中特定表的列信息

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql 列出PostgreSQL中特定表的列信息相关的知识,希望对你有一定的参考价值。

-- all info
SELECT *
FROM information_shcema.colunms
WHERE table_schema = 'public' AND table_name = '<table name>';

-- specific info
SELECT table_catalog, table_name, column_name, column_default, is_nullable, data_type
FROM information_schema.columns
WHERE table_schema = 'public'AND table_name = 'album';

以上是关于sql 列出PostgreSQL中特定表的列信息的主要内容,如果未能解决你的问题,请参考以下文章