[Catalyst] Newbie with the tutorial and Postgresql
Marcello Romani
mromani at ottotecnica.com
Wed May 30 07:09:18 GMT 2007
lbmlist at hethcote.com ha scritto:
>
> Hi all,
>
> I've been working through the tutorial, converting over to postgresql,
> and get the http://localhost:3000/books/list working fine. When I move
> to the BasicCRUD portion and the url_create
> (http://localhost:3000/books/url_create/TCPIP_Illustrated_Vol-2/5/4)
>
> my result is:
>
> Caught exception in MyApp::Controller::Books->url_create
> "DBIx::Class::ResultSet::create(): Error executing 'INSERT INTO books
> (rating, title) VALUES (?, ?)': ERROR: null value in column "id"
> violates not-null constraint"
>
>
> lib/MyAppDB/Book.pm has
>
> # Load required DBIC stuff
> __PACKAGE__->load_components(qw/PK::Auto Core/);
>
>
> which I think means that the automatci primary key should be inserte
> (although I may need to create a sequence).
>
> I am such a newbie that I'm not sure if I'm missing something with DBIC
> or should create a Pg sequence with appropriate names, or am completely
> offbase.
>
> Any assistance would be appreciated.
>
> Thanks in advance,
>
> Louis
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
Do you also have
__PACKAGE__->set_primary_key('id');
?
--
Marcello Romani
Responsabile IT
Ottotecnica s.r.l.
http://www.ottotecnica.com
More information about the Catalyst
mailing list