http://qs1969.pair.com?node_id=1176771


in reply to DBI isn't using default row values

More generally, I find default values to be hazardous.

You can have defaults at the level of your database, or at the level of a framework like DBIx::Class or Moose, or in your application code.

Invariably, after a while somehow working with your database and code will fail to read the docs or simply forgets about all these different defaults and introduces hard to trace errors. Or as in the case of the OP, just doesn't know how to trigger the defaults.

I think it is much better if the database complains loudly when a required field remains empty. Then it is immediately obvious where the error is.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics