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