-- SelectTable=
SELECT
  PD.DESCRIPTION AS COMMENT
FROM
  PG_STAT_USER_TABLES PSUT
INNER JOIN
  PG_DESCRIPTION PD
ON
  PD.OBJOID = PSUT.RELID
  AND PD.OBJSUBID = 0
WHERE
  PSUT.RELNAME = /*:Relname*/''
;
-- SelectComment=
SELECT
  PD.DESCRIPTION AS COMMENT
FROM
  PG_STAT_ALL_TABLES PS
INNER JOIN
  PG_STAT_USER_TABLES PU
ON
  PU.SCHEMANAME = PS.SCHEMANAME
  AND PU.RELNAME = PS.RELNAME
INNER JOIN
  PG_DESCRIPTION PD
ON
  PD.OBJOID = PS.RELID
INNER JOIN
  PG_ATTRIBUTE PA
ON
  PA.ATTRELID = PD.OBJOID
  AND PA.ATTNUM = PD.OBJSUBID
WHERE
  PS.RELNAME = /*:Relname*/''
  AND NOT PD.OBJSUBID = 0
  AND PA.ATTNAME = /*:Attname*/''
;
