umbrellio / sequel-batches

Sequel extension for querying large datasets in batches

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AmbiguousColumn while doing update with few tables

spaceIess opened this issue · comments

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!

Should be fixed now.