Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix postgres_*prepared_xacts_ plugins.
postgres_oldest_prepared_xact_ and postgres_prepared_xacts_ uses the same "wildcardfilter" ("WHERE database=?") in their "configquery" and their "basequery". But those two queries uses two different tables, with different columns names to refer to the database name ; the "pg_database" table has a "datname" column, while the "pg_prepared_xacts" view has a "database" column. So we can't add a "WHERE $something=?" filter as is in both queries. Let's add a gratuitous JOIN in the "basequery" (joining pg_database, so we're sure any existing database name will be joined) ; then we can use a common "WHERE datname=?" filter on both queries. Those tables columns are still the same since xact statistics where introduced, in PostgreSQL 8.1, so this plugin's config had always been broken. http://www.postgresql.org/docs/8.1/static/release-8-1.html http://www.postgresql.org/docs/8.1/static/view-pg-prepared-xacts.html http://www.postgresql.org/docs/8.1/static/catalog-pg-database.html
- Loading branch information