
Cannot add multiple references using postgres adapter
Reported by Michael Klaus | February 13th, 2008 @ 02:28 PM
The trace will look similar to
ERROR: syntax error at or near ","
LINE 4: (1, 1), (1, 2), (1, 3)
^
QUERY: " INSERT INTO "groups_profiles"
("profile_id", "group_id")
VALUES
(1, 1), (1, 2), (1, 3)"
/usr/lib/ruby/gems/1.8/gems/do_postgres-0.2.3/lib/do_postgres.rb:186:in `execute_non_query'
This is because postgres is not able to do batch inserty, but the postgres adapter does not declare so.
The error can be circumvented by following code:
module DataMapper
module Adapters
class PostgresqlAdapter
def batch_insertable?
false
end
end
end
end
Comments and changes to this ticket
-
Michael Boutros February 13th, 2008 @ 03:24 PM
Michael, can you post the code that caused this error to happen? Just so I can create a spec for it, because I don't have PostgreSQL installed. Thanks!
-
Dan Kubb (dkubb) April 15th, 2008 @ 03:30 AM
- Milestone cleared.
-
Sam Smoot May 14th, 2008 @ 10:34 PM
- Assigned user set to Adam French
Adam, can you patch in batch_insertable?;false to DM0.3?
-
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »