AmbiguousColumn while doing update with few tables
spaceIess opened this issue · comments
Andrei:D commented
Hello!
I was updating a table using some condition with another table and I catched an error
Case: DB[:table_1, :table_2].where(...).in_batches { |ds| ds.update(column: "value") }
Result: Sequel::DatabaseError: PG::AmbiguousColumn: ERROR: column reference "id" is ambiguous LINE 1: SELECT "id" FROM (SELECT * FROM "table_1", "table_2" ORDER BY...
I guess it needs to add a table name to all required selectors. Anyway, I'm looking forward to updates!
Yuri Smirnov commented
Should be fixed now.