Repair PostgreSQL 9.1 build.

I accidently forgot to special case 9.1 with the new ANALYZE
implementation...move all function definitions into #ifdef sections
so that builds against 9.1 still work.