Hardcoded sub queries in Postgres

May 22, 2016

I recently ran into an issue where I needed to write an IN filter that consumed values from a sub query and hard-coded list. While I could express this relatively elegantly using an ORM to run the subquery and append the results to an array of hardcoded strings, I was struggling with how to do so raw SQL query.