> 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,...).


Kind regards,

Daniel Struck

-- 
Retrovirology Laboratory Luxembourg
Centre Hospitalier de Luxembourg
4, rue E. Barblé
L-1210 Luxembourg

phone: +352-44116105
fax:   +352-44116113
web: http://www.retrovirology.lu
e-mail: [EMAIL PROTECTED]

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

Reply via email to