Domain Check Constraints

From: Rod Taylor <rbt(at)rbt(dot)ca>
To: PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Domain Check Constraints
Date: 2002-11-08 19:54:26
Message-ID: 1036785266.15373.297.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

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 Content-Type Size
domain.patch text/plain 65.8 KB

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2002-11-08 20:19:25 Re: Earth Distance patch
Previous Message Joe Conway 2002-11-08 19:19:47 _getPlan missing support for some Plan node elements