jeremyevans/sequel — Issue #451: invalid translation for arrays in prepared statements for PostgreSQL
Author: olek
Created: 2012-03-09 02:07:52+00:00
State: open

If prepared statement parameter is bound to array (typical for inclusions IN/ANY query), sequel translates that to '[11,22]' string, but PostgreSQL does not understand that syntax. Instead, '{foo,bar}' should be used.

Query example:

self.where('id = ANY(?)', :"$ids__integer[]")

For now, I worked around the problem by doing array to string transformation myself, like this:

:ids => '{' + subscriptions.map(&:id).join(',') + '}'