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

constraints evaluate 'now' immediately

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: constraints evaluate 'now' immediately
Date: 2000-10-16 17:42:51
Message-ID: 200010161742.e9GHgpU00706@hub.org (view raw or flat)
Thread:
Lists: pgsql-bugs
Roger Wernersson (rw(at)mindark(dot)com) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
constraints evaluate 'now' immediately

Long Description
I run Postgres 6.5.3 on Alpha/Linux.

I would like a constraint stating that a column may not have a date in the future:

CHECK(my_date <= 'now')

but I think it stores the time of constraint creation.


Sample Code
CREATE TABLE test (
    my_date timestamp NOT NULL,
    CONSTRAINT test_c_my_date CHECK (my_date <= 'now'));

--wait a second then

INSERT INTO test VALUES ('now');

-- fails


No file was uploaded with this report


Responses

pgsql-bugs by date

Next:From: Eivind KvedalenDate: 2000-10-16 19:53:21
Subject: bug-report
Previous:From: Bruce MomjianDate: 2000-10-16 16:59:21
Subject: Re: unique/references not honored when inheriting tables

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