Топ-100
top of page
Волнистый абстрактный фон
CerebroSQL

PostgreSQL DBMS table columns  

List of columns for the selected PostgreSQL table. It also displays additional information about the system columns of the table in a separate "SYSTEM COLUMN" node.  

PostgreSQL table column list

Child nodes

  • Default - value inserted into the default column

  • Not null - pointer to permission to insert Null value

  • Collation - sorting rule for the column

SELECT a.attname as column_name,
      pg_catalog.format_type(a.atttypid, a.atttypmod) as data_type,
      a.attnum,
      (SELECT substring(pg_catalog.pg_get_expr(d.adbin, d.adrelid, true) for 128)
         FROM pg_catalog.pg_attrdef d 
         WHERE d.adrelid = a.attrelid AND d.adnum = a.attnum AND a.atthasdef)  "def",
      a.attnotnull::int "attnotnull",
      (SELECT c.collname
         FROM pg_catalog.pg_collation c,
              pg_catalog.pg_type t
         WHERE c.oid = a.attcollation
           AND t.oid = a.atttypid
           AND a.attcollation <> t.typcollation) AS attcollation
 FROM pg_catalog.pg_attribute a
WHERE a.attrelid = $$TABLE_OID AND NOT a.attisdropped
ORDER BY a.attnum

bottom of page