# Reconstructed from:
# https://github.com/jordanlewis/pgjdbc/blob/462d505f01ec6180b30eaffabe51839dd126b90c/pgjdbc/src/main/java/org/postgresql/jdbc/PgDatabaseMetaData.java#L2391-L2408
opt
SELECT
    NULL AS type_cat,
    n.nspname AS type_schem,
    t.typname AS type_name,
    NULL AS class_name,
    CASE
    WHEN t.typtype = 'c' THEN 'STRUCT'
    ELSE 'DISTINCT'
    END
        AS data_type,
    pg_catalog.obj_description(t.oid, 'pg_type') AS remarks,
    CASE
    WHEN t.typtype = 'd'
    THEN (
        SELECT
            CASE
            WHEN typname = 'pgType' THEN 'sqlType'
            ELSE 'OTHER'
            END
        FROM
            pg_catalog.pg_type
        WHERE
            oid = t.typbasetype
    )
    ELSE NULL
    END
        AS base_type
FROM
    pg_catalog.pg_type AS t, pg_catalog.pg_namespace AS n
WHERE
    t.typnamespace = n.oid AND n.nspname != 'pg_catalog';
----
project
 ├── columns: type_cat:71 type_schem:35!null type_name:3!null class_name:71 data_type:72 remarks:132 base_type:133
 ├── immutable
 ├── fd: ()-->(71)
 ├── ensure-distinct-on
 │    ├── columns: t.typname:3!null t.typtype:8 nspname:35!null case:70 description:89 rownum:134!null
 │    ├── grouping columns: rownum:134!null
 │    ├── error: "more than one row returned by a subquery used as an expression"
 │    ├── immutable
 │    ├── key: (134)
 │    ├── fd: (134)-->(3,8,35,70,89)
 │    ├── left-join (hash)
 │    │    ├── columns: t.typname:3!null t.typtype:8 t.typbasetype:26 nspname:35!null pg_catalog.pg_type.oid:39 case:70 description:89 rownum:134!null
 │    │    ├── immutable
 │    │    ├── fd: (134)-->(3,8,26,35,89)
 │    │    ├── distinct-on
 │    │    │    ├── columns: t.typname:3!null t.typtype:8 t.typbasetype:26 nspname:35!null description:89 rownum:134!null
 │    │    │    ├── grouping columns: rownum:134!null
 │    │    │    ├── immutable
 │    │    │    ├── key: (134)
 │    │    │    ├── fd: (134)-->(3,8,26,35,89)
 │    │    │    ├── left-join (hash)
 │    │    │    │    ├── columns: t.oid:2!null t.typname:3!null t.typnamespace:4!null t.typtype:8 t.typbasetype:26 n.oid:34!null nspname:35!null objoid:86 classoid:87 description:89 c.oid:91 relname:92 relnamespace:93 n.oid:128 nspname:129 rownum:134!null
 │    │    │    │    ├── immutable
 │    │    │    │    ├── fd: (134)-->(2-4,8,26,34,35), (4)==(34), (34)==(4), (87)==(91), (91)==(87), (93)==(128), (128)==(93)
 │    │    │    │    ├── ordinality
 │    │    │    │    │    ├── columns: t.oid:2!null t.typname:3!null t.typnamespace:4!null t.typtype:8 t.typbasetype:26 n.oid:34!null nspname:35!null rownum:134!null
 │    │    │    │    │    ├── key: (134)
 │    │    │    │    │    ├── fd: (134)-->(2-4,8,26,34,35), (4)==(34), (34)==(4)
 │    │    │    │    │    └── inner-join (hash)
 │    │    │    │    │         ├── columns: t.oid:2!null t.typname:3!null t.typnamespace:4!null t.typtype:8 t.typbasetype:26 n.oid:34!null nspname:35!null
 │    │    │    │    │         ├── fd: (4)==(34), (34)==(4)
 │    │    │    │    │         ├── scan pg_type [as=t]
 │    │    │    │    │         │    └── columns: t.oid:2!null t.typname:3!null t.typnamespace:4 t.typtype:8 t.typbasetype:26
 │    │    │    │    │         ├── select
 │    │    │    │    │         │    ├── columns: n.oid:34 nspname:35!null
 │    │    │    │    │         │    ├── scan pg_namespace [as=n]
 │    │    │    │    │         │    │    └── columns: n.oid:34 nspname:35!null
 │    │    │    │    │         │    └── filters
 │    │    │    │    │         │         └── nspname:35 != 'pg_catalog' [outer=(35), constraints=(/35: (/NULL - /'pg_catalog') [/e'pg_catalog\x00' - ]; tight)]
 │    │    │    │    │         └── filters
 │    │    │    │    │              └── t.typnamespace:4 = n.oid:34 [outer=(4,34), constraints=(/4: (/NULL - ]; /34: (/NULL - ]), fd=(4)==(34), (34)==(4)]
 │    │    │    │    ├── inner-join (hash)
 │    │    │    │    │    ├── columns: objoid:86!null classoid:87!null description:89!null c.oid:91!null relname:92!null relnamespace:93!null n.oid:128!null nspname:129!null
 │    │    │    │    │    ├── immutable
 │    │    │    │    │    ├── fd: ()-->(92,129), (87)==(91), (91)==(87), (93)==(128), (128)==(93)
 │    │    │    │    │    ├── union-all
 │    │    │    │    │    │    ├── columns: objoid:86!null classoid:87!null description:89!null
 │    │    │    │    │    │    ├── left columns: crdb_internal.kv_catalog_comments.objoid:77 crdb_internal.kv_catalog_comments.classoid:76 crdb_internal.kv_catalog_comments.description:79
 │    │    │    │    │    │    ├── right columns: crdb_internal.kv_builtin_function_comments.oid:81 classoid:83 crdb_internal.kv_builtin_function_comments.description:82
 │    │    │    │    │    │    ├── immutable
 │    │    │    │    │    │    ├── project
 │    │    │    │    │    │    │    ├── columns: crdb_internal.kv_catalog_comments.classoid:76!null crdb_internal.kv_catalog_comments.objoid:77!null crdb_internal.kv_catalog_comments.description:79!null
 │    │    │    │    │    │    │    ├── immutable
 │    │    │    │    │    │    │    └── select
 │    │    │    │    │    │    │         ├── columns: crdb_internal.kv_catalog_comments.classoid:76!null crdb_internal.kv_catalog_comments.objoid:77!null crdb_internal.kv_catalog_comments.description:79!null objsubid:85!null
 │    │    │    │    │    │    │         ├── immutable
 │    │    │    │    │    │    │         ├── fd: ()-->(85)
 │    │    │    │    │    │    │         ├── project
 │    │    │    │    │    │    │         │    ├── columns: objsubid:85!null crdb_internal.kv_catalog_comments.classoid:76!null crdb_internal.kv_catalog_comments.objoid:77!null crdb_internal.kv_catalog_comments.description:79!null
 │    │    │    │    │    │    │         │    ├── immutable
 │    │    │    │    │    │    │         │    ├── select
 │    │    │    │    │    │    │         │    │    ├── columns: crdb_internal.kv_catalog_comments.classoid:76!null crdb_internal.kv_catalog_comments.objoid:77!null crdb_internal.kv_catalog_comments.objsubid:78!null crdb_internal.kv_catalog_comments.description:79!null
 │    │    │    │    │    │    │         │    │    ├── scan kv_catalog_comments
 │    │    │    │    │    │    │         │    │    │    └── columns: crdb_internal.kv_catalog_comments.classoid:76!null crdb_internal.kv_catalog_comments.objoid:77!null crdb_internal.kv_catalog_comments.objsubid:78!null crdb_internal.kv_catalog_comments.description:79!null
 │    │    │    │    │    │    │         │    │    └── filters
 │    │    │    │    │    │    │         │    │         └── crdb_internal.kv_catalog_comments.classoid:76 != 4294967077 [outer=(76), constraints=(/76: (/NULL - /4294967076] [/4294967078 - ]; tight)]
 │    │    │    │    │    │    │         │    └── projections
 │    │    │    │    │    │    │         │         └── crdb_internal.kv_catalog_comments.objsubid:78::INT8 [as=objsubid:85, outer=(78), immutable]
 │    │    │    │    │    │    │         └── filters
 │    │    │    │    │    │    │              └── objsubid:85 = 0 [outer=(85), constraints=(/85: [/0 - /0]; tight), fd=()-->(85)]
 │    │    │    │    │    │    └── project
 │    │    │    │    │    │         ├── columns: classoid:83!null crdb_internal.kv_builtin_function_comments.oid:81!null crdb_internal.kv_builtin_function_comments.description:82!null
 │    │    │    │    │    │         ├── fd: ()-->(83)
 │    │    │    │    │    │         ├── scan kv_builtin_function_comments
 │    │    │    │    │    │         │    └── columns: crdb_internal.kv_builtin_function_comments.oid:81!null crdb_internal.kv_builtin_function_comments.description:82!null
 │    │    │    │    │    │         └── projections
 │    │    │    │    │    │              └── 4294967045 [as=classoid:83]
 │    │    │    │    │    ├── inner-join (hash)
 │    │    │    │    │    │    ├── columns: c.oid:91!null relname:92!null relnamespace:93!null n.oid:128!null nspname:129!null
 │    │    │    │    │    │    ├── fd: ()-->(92,129), (93)==(128), (128)==(93)
 │    │    │    │    │    │    ├── select
 │    │    │    │    │    │    │    ├── columns: c.oid:91!null relname:92!null relnamespace:93
 │    │    │    │    │    │    │    ├── fd: ()-->(92)
 │    │    │    │    │    │    │    ├── scan pg_class [as=c]
 │    │    │    │    │    │    │    │    └── columns: c.oid:91!null relname:92!null relnamespace:93
 │    │    │    │    │    │    │    └── filters
 │    │    │    │    │    │    │         └── relname:92 = 'pg_type' [outer=(92), constraints=(/92: [/'pg_type' - /'pg_type']; tight), fd=()-->(92)]
 │    │    │    │    │    │    ├── select
 │    │    │    │    │    │    │    ├── columns: n.oid:128 nspname:129!null
 │    │    │    │    │    │    │    ├── fd: ()-->(129)
 │    │    │    │    │    │    │    ├── scan pg_namespace [as=n]
 │    │    │    │    │    │    │    │    └── columns: n.oid:128 nspname:129!null
 │    │    │    │    │    │    │    └── filters
 │    │    │    │    │    │    │         └── nspname:129 = 'pg_catalog' [outer=(129), constraints=(/129: [/'pg_catalog' - /'pg_catalog']; tight), fd=()-->(129)]
 │    │    │    │    │    │    └── filters
 │    │    │    │    │    │         └── relnamespace:93 = n.oid:128 [outer=(93,128), constraints=(/93: (/NULL - ]; /128: (/NULL - ]), fd=(93)==(128), (128)==(93)]
 │    │    │    │    │    └── filters
 │    │    │    │    │         └── classoid:87 = c.oid:91 [outer=(87,91), constraints=(/87: (/NULL - ]; /91: (/NULL - ]), fd=(87)==(91), (91)==(87)]
 │    │    │    │    └── filters
 │    │    │    │         └── objoid:86 = t.oid:2 [outer=(2,86), constraints=(/2: (/NULL - ]; /86: (/NULL - ]), fd=(2)==(86), (86)==(2)]
 │    │    │    └── aggregations
 │    │    │         ├── const-agg [as=t.typname:3, outer=(3)]
 │    │    │         │    └── t.typname:3
 │    │    │         ├── const-agg [as=t.typtype:8, outer=(8)]
 │    │    │         │    └── t.typtype:8
 │    │    │         ├── const-agg [as=t.typbasetype:26, outer=(26)]
 │    │    │         │    └── t.typbasetype:26
 │    │    │         ├── const-agg [as=nspname:35, outer=(35)]
 │    │    │         │    └── nspname:35
 │    │    │         └── first-agg [as=description:89, outer=(89)]
 │    │    │              └── description:89
 │    │    ├── project
 │    │    │    ├── columns: case:70!null pg_catalog.pg_type.oid:39!null
 │    │    │    ├── scan pg_type
 │    │    │    │    └── columns: pg_catalog.pg_type.oid:39!null pg_catalog.pg_type.typname:40!null
 │    │    │    └── projections
 │    │    │         └── CASE WHEN pg_catalog.pg_type.typname:40 = 'pgType' THEN 'sqlType' ELSE 'OTHER' END [as=case:70, outer=(40)]
 │    │    └── filters
 │    │         └── pg_catalog.pg_type.oid:39 = t.typbasetype:26 [outer=(26,39), constraints=(/26: (/NULL - ]; /39: (/NULL - ]), fd=(26)==(39), (39)==(26)]
 │    └── aggregations
 │         ├── const-agg [as=t.typname:3, outer=(3)]
 │         │    └── t.typname:3
 │         ├── const-agg [as=t.typtype:8, outer=(8)]
 │         │    └── t.typtype:8
 │         ├── const-agg [as=nspname:35, outer=(35)]
 │         │    └── nspname:35
 │         ├── const-agg [as=case:70, outer=(70)]
 │         │    └── case:70
 │         └── const-agg [as=description:89, outer=(89)]
 │              └── description:89
 └── projections
      ├── NULL [as=type_cat:71]
      ├── CASE WHEN t.typtype:8 = 'c' THEN 'STRUCT' ELSE 'DISTINCT' END [as=data_type:72, outer=(8)]
      ├── description:89 [as=remarks:132, outer=(89)]
      └── CASE WHEN t.typtype:8 = 'd' THEN case:70 ELSE CAST(NULL AS STRING) END [as=base_type:133, outer=(8,70)]


# Regression test for #55140. Avoid lookup joins for virtual tables.
opt
SELECT
  *
FROM
  (
    SELECT
      n.nspname,
      c.relname,
      a.attname,
      a.atttypid,
      a.attnotnull
      OR ((t.typtype = 'd') AND t.typnotnull)
        AS attnotnull,
      a.atttypmod,
      a.attlen,
      t.typtypmod,
      row_number() OVER (
        PARTITION BY a.attrelid ORDER BY a.attnum
      )
        AS attnum,
      NULL AS attidentity,
      pg_get_expr(def.adbin, def.adrelid) AS adsrc,
      dsc.description,
      t.typbasetype,
      t.typtype
    FROM
      pg_catalog.pg_namespace AS n
      JOIN pg_catalog.pg_class AS c ON (c.relnamespace = n.oid)
      JOIN pg_catalog.pg_attribute AS a ON (a.attrelid = c.oid)
      JOIN pg_catalog.pg_type AS t ON (a.atttypid = t.oid)
      LEFT JOIN pg_catalog.pg_attrdef AS def ON
          (
            (a.attrelid = def.adrelid)
            AND (a.attnum = def.adnum)
          )
      LEFT JOIN pg_catalog.pg_description AS dsc ON
          ((c.oid = dsc.objoid) AND (a.attnum = dsc.objsubid))
      LEFT JOIN pg_catalog.pg_class AS dc ON
          (
            (dc.oid = dsc.classoid)
            AND (dc.relname = 'pg_class')
          )
      LEFT JOIN pg_catalog.pg_namespace AS dn ON
          (
            (dc.relnamespace = dn.oid)
            AND (dn.nspname = 'pg_catalog')
          )
    WHERE
      (
        (
          (
            (c.relkind IN ('r', 'p', 'v', 'f', 'm'))
            AND (a.attnum > 0)
          )
          AND (NOT a.attisdropped)
        )
        AND (n.nspname LIKE 'public')
      )
      AND (c.relname LIKE '%')
  )
    AS c
WHERE
  true AND (attname LIKE '%')
ORDER BY
  nspname, c.relname, attnum;
----
sort
 ├── columns: nspname:3!null relname:8!null attname:45!null atttypid:46!null attnotnull:166 atttypmod:52 attlen:48 typtypmod:96 attnum:165 attidentity:167 adsrc:168 description:122 typbasetype:95 typtype:77
 ├── stable
 ├── fd: ()-->(3,167)
 ├── ordering: +8,+165 opt(3,167) [actual: +8,+165]
 └── project
      ├── columns: attnotnull:166 attidentity:167 adsrc:168 n.nspname:3!null c.relname:8!null attname:45!null atttypid:46!null attlen:48 atttypmod:52 typtype:77 typbasetype:95 typtypmod:96 description:122 row_number:165
      ├── stable
      ├── fd: ()-->(3,167)
      ├── select
      │    ├── columns: n.oid:2!null n.nspname:3!null c.oid:7!null c.relname:8!null c.relnamespace:9!null c.relkind:24!null attrelid:44!null attname:45!null atttypid:46!null attlen:48 attnum:49!null atttypmod:52 a.attnotnull:56 attisdropped:60!null t.oid:71!null typtype:77 typnotnull:94 typbasetype:95 typtypmod:96 adrelid:104 adnum:105 adbin:106 objoid:119 classoid:120 objsubid:121 description:122 dc.oid:124 dc.relname:125 dc.relnamespace:126 dn.oid:161 dn.nspname:162 row_number:165
      │    ├── immutable
      │    ├── fd: ()-->(3,60), (2)==(9), (9)==(2), (7)==(44), (44)==(7), (46)==(71), (71)==(46)
      │    ├── window partition=(44) ordering=+49 opt(3,7,44,60)
      │    │    ├── columns: n.oid:2!null n.nspname:3!null c.oid:7!null c.relname:8!null c.relnamespace:9!null c.relkind:24!null attrelid:44!null attname:45 atttypid:46!null attlen:48 attnum:49!null atttypmod:52 a.attnotnull:56 attisdropped:60!null t.oid:71!null typtype:77 typnotnull:94 typbasetype:95 typtypmod:96 adrelid:104 adnum:105 adbin:106 objoid:119 classoid:120 objsubid:121 description:122 dc.oid:124 dc.relname:125 dc.relnamespace:126 dn.oid:161 dn.nspname:162 row_number:165
      │    │    ├── immutable
      │    │    ├── fd: ()-->(3,60), (2)==(9), (9)==(2), (7)==(44), (44)==(7), (46)==(71), (71)==(46)
      │    │    ├── inner-join (hash)
      │    │    │    ├── columns: n.oid:2!null n.nspname:3!null c.oid:7!null c.relname:8!null c.relnamespace:9!null c.relkind:24!null attrelid:44!null attname:45 atttypid:46!null attlen:48 attnum:49!null atttypmod:52 a.attnotnull:56 attisdropped:60!null t.oid:71!null typtype:77 typnotnull:94 typbasetype:95 typtypmod:96 adrelid:104 adnum:105 adbin:106 objoid:119 classoid:120 objsubid:121 description:122 dc.oid:124 dc.relname:125 dc.relnamespace:126 dn.oid:161 dn.nspname:162
      │    │    │    ├── immutable
      │    │    │    ├── fd: ()-->(3,60), (2)==(9), (9)==(2), (7)==(44), (44)==(7), (46)==(71), (71)==(46)
      │    │    │    ├── scan pg_type [as=t]
      │    │    │    │    └── columns: t.oid:71!null typtype:77 typnotnull:94 typbasetype:95 typtypmod:96
      │    │    │    ├── left-join (hash)
      │    │    │    │    ├── columns: n.oid:2!null n.nspname:3!null c.oid:7!null c.relname:8!null c.relnamespace:9!null c.relkind:24!null attrelid:44!null attname:45 atttypid:46 attlen:48 attnum:49!null atttypmod:52 a.attnotnull:56 attisdropped:60!null adrelid:104 adnum:105 adbin:106 objoid:119 classoid:120 objsubid:121 description:122 dc.oid:124 dc.relname:125 dc.relnamespace:126 dn.oid:161 dn.nspname:162
      │    │    │    │    ├── immutable
      │    │    │    │    ├── fd: ()-->(3,60), (7)==(44), (44)==(7), (2)==(9), (9)==(2)
      │    │    │    │    ├── right-join (hash)
      │    │    │    │    │    ├── columns: n.oid:2!null n.nspname:3!null c.oid:7!null c.relname:8!null c.relnamespace:9!null c.relkind:24!null attrelid:44!null attname:45 atttypid:46 attlen:48 attnum:49!null atttypmod:52 a.attnotnull:56 attisdropped:60!null adrelid:104 adnum:105 adbin:106 objoid:119 classoid:120 objsubid:121 description:122
      │    │    │    │    │    ├── immutable
      │    │    │    │    │    ├── fd: ()-->(3,60), (7)==(44), (44)==(7), (2)==(9), (9)==(2)
      │    │    │    │    │    ├── select
      │    │    │    │    │    │    ├── columns: adrelid:104!null adnum:105!null adbin:106
      │    │    │    │    │    │    ├── scan pg_attrdef [as=def]
      │    │    │    │    │    │    │    └── columns: adrelid:104!null adnum:105 adbin:106
      │    │    │    │    │    │    └── filters
      │    │    │    │    │    │         └── adnum:105 > 0 [outer=(105), constraints=(/105: [/1 - ]; tight)]
      │    │    │    │    │    ├── right-join (hash)
      │    │    │    │    │    │    ├── columns: n.oid:2!null n.nspname:3!null c.oid:7!null c.relname:8!null c.relnamespace:9!null c.relkind:24!null attrelid:44!null attname:45 atttypid:46 attlen:48 attnum:49!null atttypmod:52 a.attnotnull:56 attisdropped:60!null objoid:119 classoid:120 objsubid:121 description:122
      │    │    │    │    │    │    ├── immutable
      │    │    │    │    │    │    ├── fd: ()-->(3,60), (7)==(44), (44)==(7), (2)==(9), (9)==(2)
      │    │    │    │    │    │    ├── project
      │    │    │    │    │    │    │    ├── columns: objoid:119!null classoid:120!null objsubid:121!null description:122!null
      │    │    │    │    │    │    │    ├── immutable
      │    │    │    │    │    │    │    ├── select
      │    │    │    │    │    │    │    │    ├── columns: crdb_internal.kv_catalog_comments.classoid:109!null crdb_internal.kv_catalog_comments.objoid:110!null crdb_internal.kv_catalog_comments.description:112!null objsubid:118!null
      │    │    │    │    │    │    │    │    ├── immutable
      │    │    │    │    │    │    │    │    ├── project
      │    │    │    │    │    │    │    │    │    ├── columns: objsubid:118!null crdb_internal.kv_catalog_comments.classoid:109!null crdb_internal.kv_catalog_comments.objoid:110!null crdb_internal.kv_catalog_comments.description:112!null
      │    │    │    │    │    │    │    │    │    ├── immutable
      │    │    │    │    │    │    │    │    │    ├── select
      │    │    │    │    │    │    │    │    │    │    ├── columns: crdb_internal.kv_catalog_comments.classoid:109!null crdb_internal.kv_catalog_comments.objoid:110!null crdb_internal.kv_catalog_comments.objsubid:111!null crdb_internal.kv_catalog_comments.description:112!null
      │    │    │    │    │    │    │    │    │    │    ├── scan kv_catalog_comments
      │    │    │    │    │    │    │    │    │    │    │    └── columns: crdb_internal.kv_catalog_comments.classoid:109!null crdb_internal.kv_catalog_comments.objoid:110!null crdb_internal.kv_catalog_comments.objsubid:111!null crdb_internal.kv_catalog_comments.description:112!null
      │    │    │    │    │    │    │    │    │    │    └── filters
      │    │    │    │    │    │    │    │    │    │         └── crdb_internal.kv_catalog_comments.classoid:109 != 4294967077 [outer=(109), constraints=(/109: (/NULL - /4294967076] [/4294967078 - ]; tight)]
      │    │    │    │    │    │    │    │    │    └── projections
      │    │    │    │    │    │    │    │    │         └── crdb_internal.kv_catalog_comments.objsubid:111::INT8 [as=objsubid:118, outer=(111), immutable]
      │    │    │    │    │    │    │    │    └── filters
      │    │    │    │    │    │    │    │         └── objsubid:118 > 0 [outer=(118), constraints=(/118: [/1 - ]; tight)]
      │    │    │    │    │    │    │    └── projections
      │    │    │    │    │    │    │         ├── crdb_internal.kv_catalog_comments.objoid:110 [as=objoid:119, outer=(110)]
      │    │    │    │    │    │    │         ├── crdb_internal.kv_catalog_comments.classoid:109 [as=classoid:120, outer=(109)]
      │    │    │    │    │    │    │         ├── objsubid:118 [as=objsubid:121, outer=(118)]
      │    │    │    │    │    │    │         └── crdb_internal.kv_catalog_comments.description:112 [as=description:122, outer=(112)]
      │    │    │    │    │    │    ├── inner-join (hash)
      │    │    │    │    │    │    │    ├── columns: n.oid:2!null n.nspname:3!null c.oid:7!null c.relname:8!null c.relnamespace:9!null c.relkind:24!null attrelid:44!null attname:45 atttypid:46 attlen:48 attnum:49!null atttypmod:52 a.attnotnull:56 attisdropped:60!null
      │    │    │    │    │    │    │    ├── fd: ()-->(3,60), (2)==(9), (9)==(2), (7)==(44), (44)==(7)
      │    │    │    │    │    │    │    ├── inner-join (merge)
      │    │    │    │    │    │    │    │    ├── columns: c.oid:7!null c.relname:8!null c.relnamespace:9 c.relkind:24!null attrelid:44!null attname:45 atttypid:46 attlen:48 attnum:49!null atttypmod:52 a.attnotnull:56 attisdropped:60!null
      │    │    │    │    │    │    │    │    ├── left ordering: +44
      │    │    │    │    │    │    │    │    ├── right ordering: +7
      │    │    │    │    │    │    │    │    ├── fd: ()-->(60), (7)==(44), (44)==(7)
      │    │    │    │    │    │    │    │    ├── select
      │    │    │    │    │    │    │    │    │    ├── columns: attrelid:44!null attname:45 atttypid:46 attlen:48 attnum:49!null atttypmod:52 a.attnotnull:56 attisdropped:60!null
      │    │    │    │    │    │    │    │    │    ├── fd: ()-->(60)
      │    │    │    │    │    │    │    │    │    ├── ordering: +44 opt(60) [actual: +44]
      │    │    │    │    │    │    │    │    │    ├── scan pg_attribute@pg_attribute_attrelid_idx [as=a]
      │    │    │    │    │    │    │    │    │    │    ├── columns: attrelid:44!null attname:45 atttypid:46 attlen:48 attnum:49 atttypmod:52 a.attnotnull:56 attisdropped:60
      │    │    │    │    │    │    │    │    │    │    └── ordering: +44
      │    │    │    │    │    │    │    │    │    └── filters
      │    │    │    │    │    │    │    │    │         ├── attnum:49 > 0 [outer=(49), constraints=(/49: [/1 - ]; tight)]
      │    │    │    │    │    │    │    │    │         └── NOT attisdropped:60 [outer=(60), constraints=(/60: [/false - /false]; tight), fd=()-->(60)]
      │    │    │    │    │    │    │    │    ├── select
      │    │    │    │    │    │    │    │    │    ├── columns: c.oid:7!null c.relname:8!null c.relnamespace:9 c.relkind:24!null
      │    │    │    │    │    │    │    │    │    ├── ordering: +7
      │    │    │    │    │    │    │    │    │    ├── scan pg_class@pg_class_oid_idx [as=c]
      │    │    │    │    │    │    │    │    │    │    ├── columns: c.oid:7!null c.relname:8!null c.relnamespace:9 c.relkind:24
      │    │    │    │    │    │    │    │    │    │    └── ordering: +7
      │    │    │    │    │    │    │    │    │    └── filters
      │    │    │    │    │    │    │    │    │         ├── c.relkind:24 IN ('f', 'm', 'p', 'r', 'v') [outer=(24), constraints=(/24: [/'f' - /'f'] [/'m' - /'m'] [/'p' - /'p'] [/'r' - /'r'] [/'v' - /'v']; tight)]
      │    │    │    │    │    │    │    │    │         └── c.relname:8 LIKE '%' [outer=(8), constraints=(/8: (/NULL - ])]
      │    │    │    │    │    │    │    │    └── filters (true)
      │    │    │    │    │    │    │    ├── select
      │    │    │    │    │    │    │    │    ├── columns: n.oid:2 n.nspname:3!null
      │    │    │    │    │    │    │    │    ├── fd: ()-->(3)
      │    │    │    │    │    │    │    │    ├── scan pg_namespace [as=n]
      │    │    │    │    │    │    │    │    │    └── columns: n.oid:2 n.nspname:3!null
      │    │    │    │    │    │    │    │    └── filters
      │    │    │    │    │    │    │    │         └── n.nspname:3 LIKE 'public' [outer=(3), constraints=(/3: [/'public' - /'public']; tight), fd=()-->(3)]
      │    │    │    │    │    │    │    └── filters
      │    │    │    │    │    │    │         └── c.relnamespace:9 = n.oid:2 [outer=(2,9), constraints=(/2: (/NULL - ]; /9: (/NULL - ]), fd=(2)==(9), (9)==(2)]
      │    │    │    │    │    │    └── filters
      │    │    │    │    │    │         ├── c.oid:7 = objoid:119 [outer=(7,119), constraints=(/7: (/NULL - ]; /119: (/NULL - ]), fd=(7)==(119), (119)==(7)]
      │    │    │    │    │    │         └── attnum:49 = objsubid:121 [outer=(49,121), constraints=(/49: (/NULL - ]; /121: (/NULL - ]), fd=(49)==(121), (121)==(49)]
      │    │    │    │    │    └── filters
      │    │    │    │    │         ├── attrelid:44 = adrelid:104 [outer=(44,104), constraints=(/44: (/NULL - ]; /104: (/NULL - ]), fd=(44)==(104), (104)==(44)]
      │    │    │    │    │         └── attnum:49 = adnum:105 [outer=(49,105), constraints=(/49: (/NULL - ]; /105: (/NULL - ]), fd=(49)==(105), (105)==(49)]
      │    │    │    │    ├── left-join (hash)
      │    │    │    │    │    ├── columns: dc.oid:124!null dc.relname:125!null dc.relnamespace:126 dn.oid:161 dn.nspname:162
      │    │    │    │    │    ├── fd: ()-->(125)
      │    │    │    │    │    ├── select
      │    │    │    │    │    │    ├── columns: dc.oid:124!null dc.relname:125!null dc.relnamespace:126
      │    │    │    │    │    │    ├── fd: ()-->(125)
      │    │    │    │    │    │    ├── scan pg_class [as=dc]
      │    │    │    │    │    │    │    └── columns: dc.oid:124!null dc.relname:125!null dc.relnamespace:126
      │    │    │    │    │    │    └── filters
      │    │    │    │    │    │         └── dc.relname:125 = 'pg_class' [outer=(125), constraints=(/125: [/'pg_class' - /'pg_class']; tight), fd=()-->(125)]
      │    │    │    │    │    ├── select
      │    │    │    │    │    │    ├── columns: dn.oid:161 dn.nspname:162!null
      │    │    │    │    │    │    ├── fd: ()-->(162)
      │    │    │    │    │    │    ├── scan pg_namespace [as=dn]
      │    │    │    │    │    │    │    └── columns: dn.oid:161 dn.nspname:162!null
      │    │    │    │    │    │    └── filters
      │    │    │    │    │    │         └── dn.nspname:162 = 'pg_catalog' [outer=(162), constraints=(/162: [/'pg_catalog' - /'pg_catalog']; tight), fd=()-->(162)]
      │    │    │    │    │    └── filters
      │    │    │    │    │         └── dc.relnamespace:126 = dn.oid:161 [outer=(126,161), constraints=(/126: (/NULL - ]; /161: (/NULL - ]), fd=(126)==(161), (161)==(126)]
      │    │    │    │    └── filters
      │    │    │    │         └── dc.oid:124 = classoid:120 [outer=(120,124), constraints=(/120: (/NULL - ]; /124: (/NULL - ]), fd=(120)==(124), (124)==(120)]
      │    │    │    └── filters
      │    │    │         └── atttypid:46 = t.oid:71 [outer=(46,71), constraints=(/46: (/NULL - ]; /71: (/NULL - ]), fd=(46)==(71), (71)==(46)]
      │    │    └── windows
      │    │         └── row-number [as=row_number:165]
      │    └── filters
      │         └── attname:45 LIKE '%' [outer=(45), constraints=(/45: (/NULL - ])]
      └── projections
           ├── a.attnotnull:56 OR ((typtype:77 = 'd') AND typnotnull:94) [as=attnotnull:166, outer=(56,77,94)]
           ├── NULL [as=attidentity:167]
           └── pg_get_expr(adbin:106, adrelid:104) [as=adsrc:168, outer=(104,106), stable]
