-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: ::regtype casts don't work for user defined types #61216
Copy link
Copy link
Closed
Labels
C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.