JeffV wrote:
> doc_id is not a PK. An accurate model of the table would be:
> set_primary_key nil

Again: determine a suitable unique index (potentially composite, say, 
doc_id and something else) and declare that as your primary key in the 
DB.  This will have many advantages and virtually no downside AFAIK.

> 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.

No, the problem is in your insistence that you don't want a PK.  Really, 
any unique index will do the trick.  Stop fighting Rails and good DB 
design and declare one. :)

> 
> Jeff
> 

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
Posted via http://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
-~----------~----~----~----~------~----~------~--~---

Reply via email to