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: (view raw, whole thread or download thread mbox)
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
    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


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-2017 The PostgreSQL Global Development Group