I have built a PosgtreSQL request that works well in my PG client tool, but don\'t work when transposed for Rails.
The request that works:
SELECT u