I would design those columns as text
and enforce value length restrictions with triggers.
It's a false problem: I define the data type for a field and
want to check his value after the exception that I can't fit
larger data into my field.
Thank you, Rod, Tom
---(end o
Tom Lane wrote:
You can't. From a logical perspective this is sensible, because the
trigger is handed data already formed into a tuple. If the presented
tuple contained a mycolumn value wider than 64 characters then it would
not be a legal value of the rowtype (any more than if, say, the column
v
base catch this error before my 'before insert'-trigger
(using character_length(new.mycolumn) ...).
Is this way of handling exceptions possible in postgres ?
If so, what is the normal way to handle this exceptions, from a
plpgsql/trigger(rule??) perspective ?
Th