当我尝试使用带问号的捕获组 (...)? 时出现错误。例如:
select p.raw
from posts p
where p.raw ~* '^(muchas )?gracias$'
limit 1;
错误信息如下:
ActiveRecord::PreparedStatementInvalid: wrong number of bind variables (1 for 2) in: /*
* DataExplorer Query
* Query: /admin/plugins/explorer?id=12
* Started by: nacho
*/
WITH query AS (
select p.raw from posts p where p.raw ~* '^(muchas )?gracias$' limit 1
) SELECT * FROM query
LIMIT 1000
直接在数据库中查询时此语句可以完美运行。请问是否有一种方法可以在 Data Explorer 中绕过此问题?