Skip to content

Fix ambiguous column errors when sorting dashboard with a CTE

Stan Hu requested to merge sh-fix-ambiguous-column-with-cte into master

In !23754 (merged) and !24408 (merged), we added a CTE optimization fence to ensure loading a user's projects is always fast when the /dashboard/projects path is loaded.

However, when sorting by a different column type (e.g. last created), PostgreSQL would raise an ambiguous column error because it wasn't clear which created_at column was needed.

To fix this problem, we should be explicit that we want to order by projects.created_at.

Edited by Stan Hu

Merge request reports

Loading