Skip to content

support range types #2859

Description

@jennifersp

the elixir postgrex client expects results from this query:

SELECT    t.oid,
          t.typname,
          t.typsend,
          t.typreceive,
          t.typoutput,
          t.typinput,
          COALESCE(d.typelem, t.typelem),
          COALESCE(r.rngsubtype, 0),
          array
          (
                   select   a.atttypid
                   FROM     pg_attribute AS a
                   WHERE    a.attrelid = t.typrelid
                   AND      a.attnum > 0
                   AND      NOT a.attisdropped
                   ORDER BY a.attnum )
FROM      pg_type AS t
LEFT JOIN pg_type AS d
ON        t.typbasetype = d.oid
LEFT JOIN pg_range AS r
ON        r.rngtypid = t.oid
OR        r.rngmultitypid = t.oid
OR        (
                    t.typbasetype <> 0
          AND       r.rngtypid = t.typbasetype)
WHERE     (
                    t.typrelid = 0)
AND       (
                    t.typelem = 0
          OR        NOT EXISTS
                    (
                           SELECT 1
                           FROM   pg_catalog.pg_type s
                           WHERE  s.typrelid != 0
                           AND    s.oid = t.typelem));

need to support range types:

 int4range
 numrange
 tsrange
 tstzrange
 daterange
 int8range

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions