Skip site navigation (1) Skip section navigation (2)

Re: Domain Check Constraints

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Rod Taylor <rbt(at)rbt(dot)ca>
Cc: PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Domain Check Constraints
Date: 2002-11-13 02:23:28
Message-ID: 200211130223.gAD2NSF12240@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-patches
Rod, do you want this added to the patches queue?

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

Rod Taylor wrote:
> Regress:
> 	test geometry             ... FAILED
> 
> But I'm using FreeBSD 4.7 RELEASE (PostgreSQL 7.4-devel)
> 
> 
> psql needs some additions to display the constraints, though I'm not
> sure what at the moment.
> 
> 
> Anyway, below is a sample:
> 
> a=# create domain i as integer not null check (value > 15 or value = 5)
> check(value < 18);
> CREATE DOMAIN
> a=# select 7::i;
> ERROR:  Domain $1 constraint i failed
> a=# select 5::i;
>  i 
> ---
>  5
> (1 row)
> 
> a=# select 15::i;
> ERROR:  Domain $1 constraint i failed
> a=# select 20::i;
> ERROR:  Domain $2 constraint i failed
> a=# select 17::i;
>  i  
> ----
>  17
> (1 row)
> 
> a=# 
> 
> -- 
>   Rod Taylor

[ Attachment, skipping... ]

> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster

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

In response to

Responses

pgsql-patches by date

Next:From: Bruce MomjianDate: 2002-11-13 02:30:45
Subject: Re: minor SGML fix
Previous:From: Alvaro HerreraDate: 2002-11-13 01:08:43
Subject: Re: CLUSTER ALL patch

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group