Using the following code:
SELECT * FROM users u
JOIN sales s ON u.id = s.user_id
WHERE u.name = "Guest" AND s.removed = false;
Postgres throws an error saying column "Guest" does not exist, even if I put name
in quotes, and yet if I remove that clause and only keep the s.remove = false
clause the query compiles. Is there a reason why it can't find a column that is not computed and mentioned in a WHERE clause?