On Fri, 2006-04-07 at 16:01 -0400, David Golombek wrote:
> I have the following Maypole app (shown here in simplified form):
<snip>
> When I try to access the versions page, I get:
> 
> > undef error - DBD::Pg::st execute failed: ERROR:  invalid input syntax for 
> > integer: "grub-doc"
> >  [for Statement "SELECT checksum, status
> > FROM   versions
> > WHERE  package=? AND version=?
> > " with ParamValues: 2='0.97-4', 1='grub-doc'] at 
> > /usr/share/perl5/DBIx/ContextualFetch.pm line 51.
> 
> That is, when maypole goes to query the db, it presents the package to
> the database via package.name intead of package.id.  However, the
> status column is handled properly.  I'm not sure why the two are being
> treated differently.  Do I have to change how the view template
> displays that item, or am I missing something here?
<snip>
>             Table "public.versions"
>   Column  |          Type          | Modifiers
> ----------+------------------------+-----------
>  package  | integer                | not null
>  version  | text                   | not null
>  checksum | character varying(256) | not null
>  status   | integer                | not null
> Indexes:
>     "versions_pkey" PRIMARY KEY, btree (package, version)
> Foreign-key constraints:
>     "versions_package_fkey" FOREIGN KEY (package) REFERENCES packages(id)
>     "versions_status_fkey" FOREIGN KEY (status) REFERENCES status(id)

Hi Dave,

Welcome to Maypole :) I don't know how much I'm going to be able to help
(I don't know Postgres) but here goes ...

It looks to me like the versions table has a multi-column primary key.
Maypole uses CDBI (Class::DBI) as its database interface by default.
CDBI can't handle multi-column primary keys AFAIK. So I think that's the
problem (or a problem). A confession: I've never dared try use CDBI with
anything other than a specific autoincrement id column (I use MySQL) and
things generally work OK.

So if you can redesign the schema to have a single-column PK, that's
probably the line of least grief. If not, you may want to run some tests
to confirm what I've said (I guess it could still be a weirdness in
Maypole). But I think you'll find more background and help about the
issue over on the CDBI list.

HTH, Dave



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Maypole-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maypole-users

Reply via email to