[Dbix-class] bug with find_or_new and update_or_insert,
for postgres DB -> work around
Patrick Weemeeuw
pweemeeuw at telenet.be
Sun Jan 6 10:13:21 GMT 2008
Analyzing the problem a bit more, I found out that, in generic terms,
find_or_new({ pk_col => undef })
creates an internal row, and that the successive insert fails to substitute
the pk_col with a value from the sequence, probably because the value has
been explicitly set.
I'm not sure whether this is a bug or 'as designed'.
Certainly, I can work around this in my application by creating a different
path in my code depending on whether I have already a value for my PK
specified or not. But at least one use case for find_or_new &
update_or_insert, i.e. being able to share the same code in a web application
both for creation and editing an entry, is not really possible.
thank you for your attention.
-- patrick
More information about the DBIx-Class
mailing list