On 15 September 2012 03:38, Darren Duncan <dar...@darrenduncan.net> wrote:
> Brian Katzung wrote:
>> If I recall correctly, I read in a cookbook somewhere (can't seem to find
>> it now) that for rows with no primary key, you can use:
>> __PACKAGE__->set_primary_key(__PACKAGE__->columns);
>> (making the entire row be a multi-column primary key).
> Well that is indeed how things should work; when there is no primary or
> unique key explicitly defined, there should be an implicit one ranging over
> all the columns.  However, SQL doesn't work that way and would allow
> duplicate rows, and so then the question is what behavior do you expect your
> Perl layer to have?  If you edit a duplicate row, is it supposed to change
> all copies or just one? -- Darren Duncan

It might be worth finding out (or, I guess you already will know) if
it's safe to delete any duplicate rows; that might render the final
question there moot :)

Certainly Brian's suggestion is quite an elegant way to do what must be done.

List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to