我有一个空的演示 rails 4 应用程序尝试执行以下操作:Collection.order('created_at ASC').uniq.pluck :name
它在 sqlite 下工作,但在 postgres 中出现以下错误:
(0.9ms) SELECT DISTINCT "collections"."name" FROM "collections" ORDER BY created_at ASC
PG::Error: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
LINE 1: ...collections"."name" FROM "collections" ORDER BY created_at...
这是一个错误还是我该如何解决?