On Sun, 2006-02-05 at 18:43 +0100, Gerhard Gonter wrote:
> Gerhard Gonter wrote:
> > When I try to add a row via a list form to a postgresql database, the
> > following error occurs:
> > 
> >   Error code: 1
> >   pq_baseresultset: row index out of range, allowed is 0 to -1, got 0
> 
> After playing around with a few more forms and tables, I fixed the
> problem above and came to these two conclusions:
> 
> 1. a table needs to have a primary key, otherwise the table can't be
>    edited.  The existence of the oid column is not sufficient (pgAdmin
>    is happy when there is an oid).
> 2. the primary key must be the first column of the table.  If a primary
>    key is added to the table later on, the error mentioned above occurs.
> 
> So, all I had to do was to recreate the tables with a primary key column
> as the first column in the table.

That (the first column restriction) must be a limitation in the sdbc
driver. I haven't found this problem with the JDBC driver from
PostgreSQL.org.

It may be that the sdbc driver is still relying on the fact that earlier
PostgreSQL releases automatically included an OID column in every table
(usually the first column from memory) - which provided the unique index
that the primary key is now required to provide in order for updates to
work.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to