Re: Domains and subtypes, a brief proposal

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Domains and subtypes, a brief proposal
Дата
Msg-id 23683.1157750418@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Domains and subtypes, a brief proposal  (elein <elein@varlena.com>)
Ответы Re: Domains and subtypes, a brief proposal  (elein <elein@varlena.com>)
Список pgsql-hackers
elein <elein@varlena.com> writes:
> I think what you are saying is that the domain checking (proposed constraint
> existence checking) would need to be done in more places and I'm not sure I 
> understand this.

What I'm complaining about is the need to search the catalogs to see if
a datatype has constraints.  At the moment we need to do that only
for operations yielding domain types.  Your proposal appears to require
that it be done for *every* operation on *every* datatype, right down
to int4 and bool (which at the very least creates some interesting
circularity issues).  I'm not willing to accept that much overhead on
the strength of what is frankly a pretty weak case.  If you want a
constraint, what's wrong with putting a domain on your base type to
enforce it?

> And checking for constraint <> NULL should be equivalent to the 
> current check *typtype != 'd'.

Not without an amazingly complicated substructure to the "constraint"
column (multiple entries, names as well as expressions, etc).  At the
very least that's a violation of relational theory, and I'm not sure how
we're going to handle dependencies of the constraint expressions at all
if they aren't separate catalog entries.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Fixed length data types issue
Следующее
От: "Mark Woodward"
Дата:
Сообщение: Mapping arbitriary and heirachical XML to tuple