Re: DROP TYPE/DROP DOMAIN - Mailing list pgsql-hackers

From Tom Lane
Subject Re: DROP TYPE/DROP DOMAIN
Date
Msg-id 21945.1060091770@sss.pgh.pa.us
Whole thread Raw
In response to Re: DROP TYPE/DROP DOMAIN  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
List pgsql-hackers
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> Will DROP TYPE automatically handle dropping constraints and dependent
> columns properly?

Sure.  Once you get down to the dependency-chaser, a type is a type.

> Will all its messages use the word 'domain' and not
> 'type'? 

No, but I wouldn't bet on DROP DOMAIN uniformly saying "domain" either.
It's the same code as soon as you get below the top-level command
routine (compare RemoveType and RemoveDomain).

> I can't see any conceivable reason to allow this syntax to work!
> We are giving zero benefit for a non-zero cost...

I'd state that exactly the other way around: testing for and rejecting
domains in DROP TYPE will take more code (okay, only a few lines, but
still more code) and I consider the benefit nil.

If you try to make every message in the system distinguish "type" from
"domain", then you are talking about a *lot* more code, for even less
benefit.  Also there are places where you simply can't know which to
say --- should "type not found" be changed to "domain not found"?
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Shridhar Daithankar"
Date:
Subject: Re: 7.4 beta binaries
Next
From: Tom Lane
Date:
Subject: Re: "truncate all"?