> 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.
I had just an example, where it would have been convenient, if one could change the type.
Let's say you want to give the users the possibility to enter incomplete dates (year, year&month or the complete date). Indeed you could not insert this information as it is. But later on for stats you would like to be able to treat the column as a date.
I have implemented it by storing the user information in a varchar column and inserting the whole date in another column.
(if the user only provides the year, the date is inserted as 16.05.year,...).
Retrovirology Laboratory Luxembourg
Centre Hospitalier de Luxembourg
4, rue E. Barblé
In response to
pgsql-bugs by date
|Next:||From: PostgreSQL Bugs List||Date: 2004-02-11 13:56:15|
|Subject: BUG #1078: Ref #1045 hostname lookup does not work|
|Previous:||From: PostgreSQL Bugs List||Date: 2004-02-10 22:54:33|
|Subject: BUG #1077: install-strip does not work for MacOS X 10.2.8|