parent
6a0798eb06
commit
929109622e
1 changed files with 2 additions and 0 deletions
|
|
@ -57,6 +57,7 @@ func getColumnsMetaData(db *sql.DB, schemaName string, tableName string) ([]meta
|
||||||
query := `
|
query := `
|
||||||
select
|
select
|
||||||
attr.attname as "column.Name",
|
attr.attname as "column.Name",
|
||||||
|
dsc.description as "column.Comment",
|
||||||
exists(
|
exists(
|
||||||
select 1
|
select 1
|
||||||
from pg_catalog.pg_index indx
|
from pg_catalog.pg_index indx
|
||||||
|
|
@ -81,6 +82,7 @@ from pg_catalog.pg_attribute as attr
|
||||||
join pg_catalog.pg_class as cls on cls.oid = attr.attrelid
|
join pg_catalog.pg_class as cls on cls.oid = attr.attrelid
|
||||||
join pg_catalog.pg_namespace as ns on ns.oid = cls.relnamespace
|
join pg_catalog.pg_namespace as ns on ns.oid = cls.relnamespace
|
||||||
join pg_catalog.pg_type as tp on tp.oid = attr.atttypid
|
join pg_catalog.pg_type as tp on tp.oid = attr.atttypid
|
||||||
|
left join pg_catalog.pg_description as dsc on dsc.objoid = attr.attrelid and dsc.objsubid = attr.attnum
|
||||||
where
|
where
|
||||||
ns.nspname = $1 and
|
ns.nspname = $1 and
|
||||||
cls.relname = $2 and
|
cls.relname = $2 and
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue