<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/monitoring.sgml,v 1.11 2002/08/17 13:04:14 momjian Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/monitoring.sgml,v 1.12 2002/08/20 04:47:52 momjian Exp $
-->
<chapter id="monitoring">
Current query of backend process (NULL if caller is not superuser)
</entry>
</row>
+
+ <row>
+ <entry><function>pg_stat_reset</function>()</entry>
+ <entry><type>boolean</type></entry>
+ <entry>
+ Reset all currently collected statistics.
+ </entry>
+ </row>
</tbody>
</tgroup>
</table>
extern Datum pg_stat_get_backend_idset(PG_FUNCTION_ARGS);
extern Datum pg_backend_pid(PG_FUNCTION_ARGS);
+extern Datum pg_stat_reset(PG_FUNCTION_ARGS);
extern Datum pg_stat_get_backend_pid(PG_FUNCTION_ARGS);
extern Datum pg_stat_get_backend_dbid(PG_FUNCTION_ARGS);
extern Datum pg_stat_get_backend_userid(PG_FUNCTION_ARGS);
PG_RETURN_INT32(MyProcPid);
}
+/*
+ * Built-in function for resetting the counters
+ *
+ */
+Datum
+pg_stat_reset(PG_FUNCTION_ARGS)
+{
+ pgstat_reset_counters();
+
+ PG_RETURN_BOOL(true);
+}
Datum
pg_stat_get_backend_pid(PG_FUNCTION_ARGS)
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_proc.h,v 1.257 2002/08/20 04:45:59 momjian Exp $
+ * $Id: pg_proc.h,v 1.258 2002/08/20 04:47:52 momjian Exp $
*
* NOTES
* The script catalog/genbki.sh reads this file and generates .bki
DESCR("Statistics: Currently active backend IDs");
DATA(insert OID = 2026 ( pg_backend_pid PGNSP PGUID 12 f f t f s 0 23 "" pg_backend_pid - _null_ ));
DESCR("Statistics: Current backend PID");
+DATA(insert OID = 2274 ( pg_stat_reset PGNSP PGUID 12 f f f f v 0 16 "" pg_stat_reset - _null_ ));
+DESCR("Statistics: Reset collected statistics");
DATA(insert OID = 1937 ( pg_stat_get_backend_pid PGNSP PGUID 12 f f t f s 1 23 "23" pg_stat_get_backend_pid - _null_ ));
DESCR("Statistics: PID of backend");
DATA(insert OID = 1938 ( pg_stat_get_backend_dbid PGNSP PGUID 12 f f t f s 1 26 "23" pg_stat_get_backend_dbid - _null_ ));