<entry><structfield>checksum_failures</structfield></entry>
<entry><type>bigint</type></entry>
<entry>Number of data page checksum failures detected in this
- database</entry>
+ database (or on a shared object), or NULL if data checksums are not
+ enabled.</entry>
</row>
<row>
<entry><structfield>checksum_last_failure</structfield></entry>
<entry><type>timestamp with time zone</type></entry>
<entry>Time at which the last data page checksum failure was detected in
- this database, or on a shared object.</entry>
+ this database (or on a shared object), or NULL if data checksums are not
+ enabled.</entry>
</row>
<row>
<entry><structfield>blk_read_time</structfield></entry>
D.oid AS datid,
D.datname AS datname,
CASE
- WHEN (D.oid = (0)::oid) THEN NULL::integer
+ WHEN (D.oid = (0)::oid) THEN 0
ELSE pg_stat_get_db_numbackends(D.oid)
END AS numbackends,
pg_stat_get_db_xact_commit(D.oid) AS xact_commit,
#include "postgres.h"
#include "access/htup_details.h"
+#include "access/xlog.h"
#include "catalog/pg_authid.h"
#include "catalog/pg_type.h"
#include "common/ip.h"
int64 result;
PgStat_StatDBEntry *dbentry;
+ if (!DataChecksumsEnabled())
+ PG_RETURN_NULL();
+
if ((dbentry = pgstat_fetch_stat_dbentry(dbid)) == NULL)
result = 0;
else
TimestampTz result;
PgStat_StatDBEntry *dbentry;
+ if (!DataChecksumsEnabled())
+ PG_RETURN_NULL();
+
if ((dbentry = pgstat_fetch_stat_dbentry(dbid)) == NULL)
result = 0;
else
pg_stat_database| SELECT d.oid AS datid,
d.datname,
CASE
- WHEN (d.oid = (0)::oid) THEN NULL::integer
+ WHEN (d.oid = (0)::oid) THEN 0
ELSE pg_stat_get_db_numbackends(d.oid)
END AS numbackends,
pg_stat_get_db_xact_commit(d.oid) AS xact_commit,