[CDBI] Working with tables without primary keys?

Perrin Harkins perrin at elem.com
Mon Nov 7 23:49:51 GMT 2005


On Mon, 2005-11-07 at 17:24 -0600, Eamon Daly wrote:
>  What's the Right Way to work with tables lacking
> primary keys?

Not supported.

> Given a table like this:
> 
> +--------+----------+
> | foo_id | foo_name |
> +--------+----------+
> |      0 | bar-1    |
> |      8 | bar-2    |
> |      3 | bar-3    |
> |      8 | bar-4    |
> |      7 | bar-5    |
> |      4 | bar-6    |
> |      7 | bar-7    |
> |      4 | bar-8    |
> |      0 | bar-9    |
> +--------+----------+

The primary key of that table seems to be (foo_id, foo_name).  At least
there are no dupes in this sample data.  Just set that as your primary
key.

- Perrin





More information about the ClassDBI mailing list