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

Re: abnormal behaviour of a CHECK CONSTRAINT with a regular expression when a trigger is added

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniel Struck <struck(dot)d(at)retrovirology(dot)lu>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: abnormal behaviour of a CHECK CONSTRAINT with a regular expression when a trigger is added
Date: 2004-02-10 16:23:15
Message-ID: 15682.1076430195@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
Daniel Struck <struck(dot)d(at)retrovirology(dot)lu> writes:
> This makes it also impossible to change the type of a value by a trigger?

Correct.  It is annoying in some cases, but if the input to the trigger
isn't of the column datatype, then what type is it?  It's hard to see
how that could work in general.

If you want, say, a varchar length constraint to be checked only after
the trigger runs, I'd counsel declaring the column as plain text and
writing the length test as a CHECK constraint.

			regards, tom lane

In response to

Responses

pgsql-bugs by date

Next:From: PostgreSQL Bugs ListDate: 2004-02-10 22:54:33
Subject: BUG #1077: install-strip does not work for MacOS X 10.2.8
Previous:From: Tom LaneDate: 2004-02-10 16:12:39
Subject: Re: [BUGS] Probably a security bug in PostgreSQL rule system

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