Skip to content

sql: ::regtype casts don't work for user defined types #61216

@jordanlewis

Description

@jordanlewis

Currently, trying to cast from a type id to a type name via ::regtype does not work if the type is user-defined.

Repro:

demo@127.0.0.1:26257/defaultdb> create type t as enum('a', 'b');
CREATE TYPE

Time: 6ms total (execution 6ms / network 0ms)

demo@127.0.0.1:26257/defaultdb> select oid::regtype from pg_type where typname = 't';
   oid
----------
  100052
(1 row)

Time: 5ms total (execution 4ms / network 0ms)

demo@127.0.0.1:26257/defaultdb>

This should return t, not 100052.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions