ActiveRecord::StatementInvalid: PG::InvalidColumnReference: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in sele...
https://sentry.gitlab.net/gitlab/gitlabcom/issues/1559059/?referrer=gitlab_plugin
PG::InvalidColumnReference: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
LINE 1: ...ILIKE '%redacted%') OR "users"."email" = 'redacted') ORDER BY CASE
^
active_record/connection_adapters/postgresql_adapter.rb:672:in `exec_params'
@connection.exec_params(sql, type_casted_binds)
active_record/connection_adapters/postgresql_adapter.rb:672:in `block (2 levels) in exec_no_cache'
@connection.exec_params(sql, type_casted_binds)
active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
yield
active_support/concurrency/share_lock.rb:187:in `yield_shares'
yield
active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
@lock.yield_shares(compatible: [:load]) do
...
(164 additional frame(s) were not displayed)
ActiveRecord::StatementInvalid: PG::InvalidColumnReference: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
LINE 1: ...ILIKE '%redacted%') OR "users"."email" = 'redacted') ORDER BY CASE
^
ActiveRecord::StatementInvalid: PG::InvalidColumnReference: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
LINE 1: ...ILIKE '%redacted%') OR "users"."email" = 'redacted') ORDER BY CASE
^
Edited by Alessio Caiazza