[Catalyst] How to update row in Postgres when SERIAL PRIMARY KEY?
Dennis Daupert
ddaupert at sbcglobal.net
Tue Jul 4 19:55:18 CEST 2006
I know how in mysql, but still new to postgresql, trying to learn. In mysql, when there's an autoincremented integer primary key, you don't mention that field on inserts; it just gets handled. In postgresql, when I try that, he complains. Also complains if I try to set id to '', 'undef', 'DEFAULT', and various other tries.
ID field definition:
id SERIAL NOT NULL PRIMARY KEY,
The insert statement:
$c->stash->{quote} = $c->model('CatapultDB::Quotes')->create({
id => 'DEFAULT',
quote => $c->request->params->{quote},
author => $c->request->params->{author},
category => $c->request->params->{category},
active => 'true'
});
best,
/dennis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20060704/7f0f9c67/attachment.htm
More information about the Catalyst
mailing list