Description
It's possible to define circular/recursive types using ALTER TYPE. They won't work in practice when you try to insert data, but we should detect this earlier and prevent the type modification.
Recursive type example (from JAVA-908):
CREATE TYPE node (name text,); ALTER TYPE node ADD children frozen<list<node>>;
Circular example (from Stack overflow):
create type ping(pingid int); create type pong(pongid int, ping frozen<ping>); alter type ping ADD pong frozen<pong>;
Note that, in the circular example, references are properly checked when dropping the types, so neither type can be dropped.
Attachments
Issue Links
- links to