Re: Domains as Subtypes - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Domains as Subtypes
Date
Msg-id 200603242033.52023.peter_e@gmx.net
Whole thread Raw
In response to Domains as Subtypes  (elein <elein@varlena.com>)
Responses Re: Domains as Subtypes  (elein <elein@varlena.com>)
List pgsql-hackers
elein wrote:
> Domains lay the groundwork for inherited basetypes
> or subtypes.

Semantically, a domain and a subtype are completely different things.  A 
domain restricts the possible values of a type but behaves exactly like 
that type in all other respects.  (The fact that PostgreSQL allows you 
to define functions that take domains as arguments undermines that 
concept but if you apply it carefully it can still work.)  Subtypes or 
inherited types on the other hand are defined exactly for the purpose 
of overriding some of their methods (while keeping others unchanged, 
hence the inheritance).  Mixing the two concepts might be convenient 
from an implementation point of view but makes no sense in the data 
model.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Role incompatibilities
Next
From: Stephen Frost
Date:
Subject: Re: Role incompatibilities