On 3 Apr 2008, at 16:30, Alex Povolotsky wrote:
Attempt to insert into postgres table with undef's for columns with
default values yields an error. It is especially bad with
find_or_create sub.
I've made and tested a simple patch, it looks working ok.
So the problem is that when you *explicitly* set column values to
undef (NULL), DBIC does not magically put default values in place?
Adding that (and the patch only touches Pg - thus making Pg behave
differently to all the other databases) appears like too much (or
inappropriate) magic to me.
I'd be happier with something that generically puts default values in
when the key/value to insert was missed out altogether, but in general
I tend to let the DB do that. At present it looks like default_value
is used only by deploy.
Nigel.
--
[ Nigel Metheringham [EMAIL PROTECTED] ]
[ - Comments in this message are my own and not ITO opinion/policy - ]
_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[EMAIL PROTECTED]