aboutsummaryrefslogtreecommitdiff
path: root/src/include/pgstat.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-02-07 23:11:30 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-02-07 23:11:30 +0000
commitaec4cf1c8c410f9c9db3deabcb94502dcd355b3f (patch)
tree18ff3f246c08608d5b09f3da0d267a51f3318378 /src/include/pgstat.h
parentd9ce68872f7f6aab6cea2481b991b3c1a83d1956 (diff)
downloadpostgresql-aec4cf1c8c410f9c9db3deabcb94502dcd355b3f.tar.gz
postgresql-aec4cf1c8c410f9c9db3deabcb94502dcd355b3f.zip
Add a function pg_stat_clear_snapshot() that discards any statistics snapshot
already collected in the current transaction; this allows plpgsql functions to watch for stats updates even though they are confined to a single transaction. Use this instead of the previous kluge involving pg_stat_file() to wait for the stats collector to update in the stats regression test. Internally, decouple storage of stats snapshots from transaction boundaries; they'll now stick around until someone calls pgstat_clear_snapshot --- which xact.c still does at transaction end, to maintain the previous behavior. This makes the logic a lot cleaner, at the price of a couple dozen cycles per transaction exit.
Diffstat (limited to 'src/include/pgstat.h')
-rw-r--r--src/include/pgstat.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/include/pgstat.h b/src/include/pgstat.h
index e64fb8bf550..896cc5ad68c 100644
--- a/src/include/pgstat.h
+++ b/src/include/pgstat.h
@@ -5,7 +5,7 @@
*
* Copyright (c) 2001-2007, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/include/pgstat.h,v 1.52 2007/01/05 22:19:50 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/pgstat.h,v 1.53 2007/02/07 23:11:30 tgl Exp $
* ----------
*/
#ifndef PGSTAT_H
@@ -380,6 +380,7 @@ extern void pgstat_report_tabstat(void);
extern void pgstat_vacuum_tabstat(void);
extern void pgstat_drop_relation(Oid relid);
+extern void pgstat_clear_snapshot(void);
extern void pgstat_reset_counters(void);
extern void pgstat_report_autovac(Oid dboid);