Re: Basic DOMAIN Support - Mailing list pgsql-patches

From Rod Taylor
Subject Re: Basic DOMAIN Support
Date
Msg-id 092d01c1c651$72e3b1e0$b002000a@jester
Whole thread Raw
In response to Re: Basic DOMAIN Support  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Basic DOMAIN Support  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
> "Rod Taylor" <rbt@zort.ca> writes:
> >> copyfuncs.c:2232: warning: `_copyCreateDomainStmt' defined but
not
> > used
>
> > Commented out, but left in for potential use.
>
> Wrong answer --- what this is reminding you is that you forgot to
call
> it.

Yeah, that was my thought too -- when I created it I was unable to
find how to use it.  Just that I noticed a TODO item stating that
everything should have one. I guess I don't understand -- among other
things -- why DomainStmt needs to be copied?  Found the switch at the
bottom of copyfuncs.c, and have added the element.


> Also, I'm fairly confused by the code in MergeDomainAttributes and
> DefineDomain.  You seem to have modeled this on table creation, not
> type creation, which makes little or no sense to me.  Where in the
> heck does a domain "inherit" from?

MergeDomainAttributes pushes the domains configuration onto a table
field during table creation where the field type is a domain.
Overkill for defaults, but will be very useful once domains have
various constraints.  In this way the table is very much inheriting
the attributes of the domain.  This was created as per your suggestion
that a table should take on domain attributes during creation rather
than during execution.

Define domain pulls in attributes of a type BUT has to process things
such as Defaults, Not NULL constraints and eventually CHECK
constraints, Foreign keys.  Those items are very much like table
fields, just stored elsewhere.


pgsql-patches by date:

Previous
From: "Rod Taylor"
Date:
Subject: Re: Basic DOMAIN Support
Next
From: Bruce Momjian
Date:
Subject: Re: Basic DOMAIN Support