Is it though? Is the Postgres optimizer that much worse? As for the ORM, I was trying to point out that something like ActiveRecord doesn't rely on the inherent capabilities of the RDBMS as much as raw SQL might. So things like stored procedures, triggers, advanced CTEs, etc. don't really add any value.
What tends to happen is death by a thousand cuts. Postgres can probably be tuned to efficiently run most queries that SQL Server could run, but DBA time is spent on it when on SQL Server the issue might just simply not exist. It also really helps power users who know enough SQL to write a report, but maybe not enough to tune queries.