doc_id is not a PK. An accurate model of the table would be: set_primary_key nil But the PG postgres adapter is unhappy with that because it's generating something like: INSERT into the_table VALUES (val1, val2...) RETURNING pk when pk is nil the postgres adapter is unhappy. For some reason the composite_primary_keys plugin fixes the problem (as only a single PK is specified). To me the problem is the PG adapter. I don't know why it uses RETURNING in its INSERT statement.
Jeff On Oct 20, 9:14 am, Marnen Laibow-Koser <rails-mailing-l...@andreas- s.net> wrote: > JeffV wrote: > > Solved (at least for now): > > I used the composite primary keys plugin but listed only a single (and > > fake) primary key: > > set_primary_keys :doc_id # note plural! > > > :doc_id is not a PK, and for this logging table it's possible there is > > no combination of columns that will yield a single row, depending on > > the timing of multi- inserts. But the insert now works and I can move > > on! > > Great! Now declare doc_id as the PK in the DB. > > > Jeff > > Best, > -- > Marnen Laibow-Koserhttp://www.marnen.org > [email protected] > -- > Posted viahttp://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

