Andrew Gierth <andrew@tao11.riddles.org.uk> writes:
> Oh wow, I hadn't noticed that dropping a function referenced from a
> domain's default or constraint drops the whole domain rather than just
> removing the default or constraint the way it would with a table.
Ouch. Seems like possibly a bug ... shouldn't we make only that
constraint depend on the function? But that's orthogonal to the
DROP DOMAIN behavior you were describing.
> (If it were not the case, then the only way we'd end up cascading to
> dropping a domain would be if we dropped the base type, in which case
> the columns are going to go away anyway)
Nope, drop schema and drop owned by (at the least) could also cascade to
a domain.
regards, tom lane