in reply to Problem with Class::DBI's create
Postgres, unless I am terribly mistaken, uses sequences to generate IDs. Class::DBI requires that you identify the sequences, if used.
$class->sequence( $sequence_name );
For your code, that should probably be something like the following in your base class:
Gallery::Image->sequence('gallery_images_id_seq');
I also see that you're calling $class->commit without calling $class->dbi_commit. If you have transactions enabled, you'll have to call the latter after the former as the commit() method has nothing to do with committing a transaction. You may wish to read the docs about this issue. It's been a source of confusion here at work (and I stills screw it up).
Cheers,
Ovid
New address of my CGI Course.
Silence is Evil (feel free to copy and distribute widely - note copyright text)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Problem with Class::DBI's create
by Molt (Chaplain) on Jan 15, 2003 at 22:47 UTC |