[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] Bits which seem to not work/missing

From: Karsten Hilbert
Subject: Re: [Gnumed-devel] Bits which seem to not work/missing
Date: Thu, 12 Jan 2006 12:15:52 +0100
User-agent: Mutt/1.5.11

On Wed, Jan 11, 2006 at 09:00:04AM +1100, Richard wrote:

> In this table, my compile crashes at the places I've marked ****, the compile 
> stops and asks for a parameter input. Obviously if I comment out that line, 
> include a comma after not null, it compiles. Any ideas.
> create table clin.vacc_def (
>       id serial primary key,
>       fk_regime integer
>               not null
>               references clin.vacc_regime(id)
>               on delete cascade
>               on update cascade,
>       is_booster boolean
>               not null
>               default false,
>       seq_no integer
>               default null,
>       min_age_due interval
>               not null
>               ****check (min_age_due > '0 seconds'::interval),
>       max_age_due interval
>               default null
>               ****check ((max_age_due is null) or (max_age_due >= 
> min_age_due)),
>       min_interval interval
>               default null,
>       comment text,
>       unique(fk_regime, seq_no)
This works perfectly normal in all instances of PG I have
heard of. I suspect pgAdmin.

The one flaky thing here might be that the PG docs say that
column check constraints are not supposed to reach out to
other columns, not even within the same row, I believe. Now,
max_age_due is checked against min_age_due which would
violate that assertion. However, it has always worked in any
version of PG, contrary to the documentation.

This would also not explain why the min_age_due check fails.

GPG key ID E4071346 @
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

reply via email to

[Prev in Thread] Current Thread [Next in Thread]