Subject: Caveat for Domains

From: David Fetter <[email-masked]>
Date: Fri, 9 Sep 2005 14:58:26 -0700

Folks,

I think this needs to be made explicit in the documentation.  Better,
of course, would be some kind of change to the PL infrastructure that
Just Handles It, but until then....

Cheers,
D
-- 
David Fetter [email-masked] http://fetter.org/
phone: +1 510 893 6100   mobile: +1 415 235 3778

Remember to vote!
Index: doc/src/sgml/ref/create_domain.sgml
===================================================================
RCS file: /projects/cvsroot/pgsql/doc/src/sgml/ref/create_domain.sgml,v
retrieving revision 1.22
diff -c -r1.22 create_domain.sgml
*** doc/src/sgml/ref/create_domain.sgml	2 May 2005 01:52:50 -0000	1.22
--- doc/src/sgml/ref/create_domain.sgml	9 Sep 2005 21:21:39 -0000
***************
*** 48,57 ****
    </para>
  
    <para>
!    Domains are useful for abstracting common fields between tables into
!    a single location for maintenance.  For example, an email address column may be used
!    in several tables, all with the same properties.  Define a domain and
!    use that rather than setting up each table's constraints individually.
    </para>
   </refsect1>
  
--- 48,60 ----
    </para>
  
    <para>
!    Domains are useful for abstracting common fields between tables
!    into a single location for maintenance.  For example, an email address
!    column may be used in several tables, all with the same properties.
!    Define a domain and use that rather than setting up each table's
!    constraints individually. <note>Keep in mind also that declaring a
!    function result value as a domain is pretty dangerous, because none of
!    the PLs enforce domain constraints on their results.</note>
    </para>
   </refsect1>

---

From: Bruce Momjian <[email-masked]>
Date: Fri, 16 Sep 2005 15:52:37 -0400 (EDT)

Your patch has been added to the PostgreSQL unapplied patches list at:

	http://momjian.postgresql.org/cgi-bin/pgpatches

It will be applied as soon as one of the PostgreSQL committers reviews
and approves it.

---------------------------------------------------------------------------

> Just Handles It, but until then....

[ Attachment, skipping... ]

> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  [email-masked]               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

---

From: Bruce Momjian <[email-masked]>
Date: Thu, 22 Sep 2005 19:57:35 -0400 (EDT)

Patch applied.  Thanks.

---

From: David Fetter <[email-masked]>
Date: Wed, 19 Oct 2005 22:49:47 -0700

> Patch applied.  Thanks.

Could you please put fixing domains for functions on the TODO list?

Cheers,
D

Remember to vote!

---

From: Bruce Momjian <[email-masked]>
Date: Mon, 24 Oct 2005 14:09:04 -0400 (EDT)

> Could you please put fixing domains for functions on the TODO list?

Added to TODO:

* Allow user-defined functions retuning a domain value to enforce domain
  constraints