[Dbix-class] Bug with find_or_new and insert_or_update with postgresql: any success?

Alex Povolotsky tarkhil at over.ru
Mon Feb 25 20:53:19 GMT 2008


Hello!

I've found in archives nearly my case, that passing NULL to Pg is not 
'not passing column at all', so adding a new row with a simple code like 
this

  my $loc = $c->model($self->model_name)->find_or_new({lid => $id});
  if ($form->submitted && $form->validate) {
    # Fill in 
data                                                                                            

    $loc->name($form->field('name'));
    $loc->descr($form->field('descr'));
    $loc->update_or_insert();
    $c->req->redirect($c->uri_for('list'));
  }

is impossible.

Maybe someone has found a good way to solve the problem, or at least a 
working workaround?

Alex.




More information about the DBIx-Class mailing list