Re: Basic DOMAIN Support

From: "Rod Taylor" <rbt(at)zort(dot)ca>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Basic DOMAIN Support
Date: 2002-03-08 03:27:27
Message-ID: 092d01c1c651$72e3b1e0$b002000a@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

> "Rod Taylor" <rbt(at)zort(dot)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.

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2002-03-08 03:27:36 Re: Basic DOMAIN Support
Previous Message Rod Taylor 2002-03-08 03:07:15 Re: Basic DOMAIN Support