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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-bugs by date

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