Re: constraints evaluate 'now' immediately

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: rw@mindark.com, pgsql-bugs@postgresql.org
Date: 2000-10-16T20:06:03Z
Lists: pgsql-bugs
pgsql-bugs@postgresql.org writes:
> 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.

Yes, because 'now' is evaluated when the constant is parsed.  Try
	CHECK(my_date <= now())
instead.

			regards, tom lane