Michael Fuhr <mike@fuhr.org> writes:
> Would it make sense for DROP TYPE to have some kind of limited
> cascade so you could drop a type and its I/O functions at the same
> time, but still get an error if other objects depend on the type?
Seems pretty ugly. Maybe the thing to do is have a command that somehow
reverts a type to the "shell" state, whereupon the deletion sequence can
be the exact logical inverse of the creation sequence:
* drop other dependencies* shell-ify type* drop I/O functions* drop shell type
What's not very clear to me though is how you determine whether it's
safe to shell-ify the type. I don't think you want to allow that as
long as any columns of the type remain, for instance. If this requires
verifying that it has no remaining dependencies except the I/O
functions, then it seems no different really from a "limited cascade".
regards, tom lane