diff --git a/lib/data_layer.ex b/lib/data_layer.ex index 775c0425..1f3a6ffb 100644 --- a/lib/data_layer.ex +++ b/lib/data_layer.ex @@ -701,7 +701,7 @@ defmodule AshPostgres.DataLayer do query = default_bindings(query, resource) query = - if query.distinct do + if query.distinct || query.limit do query = query |> Ecto.Query.exclude(:select)