In psql, trying to reference alias in WHERE clause:
WHERE
SELECT SUBSTRING(pk, 6, 2)::INT AS _year FROM listing WHERE _year > 90
Try this way
select * from (SELECT SUBSTRING(pk, 6, 2)::INT AS _year FROM listing) a where _year>90