fix comatibility with PostgreSQL 9.2

Postgres_* plugins didn't work with PostgreSQL 9.2.x because
they used queries designed for pre-9.1 DB versions.