summaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-11-24 21:18:42 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-11-24 21:18:42 +0000
commit988a87a03a28146f9a106250e92aa73c43ed8f78 (patch)
tree9bcb8b09ad61e839cde7636ab0c38ea7455678b5 /src/backend
parent2822c7c0fce20db579c0ae7042529a418ff41d48 (diff)
downloadpostgresql-988a87a03a28146f9a106250e92aa73c43ed8f78.tar.gz
Change pg_stat_all_tables and sister views to put the recently-added
vacuum/analyze timestamp columns at the end, rather than at a random spot in the middle as in the original patch. This was deemed more usable as well as less likely to break existing application code. initdb forced accordingly. In passing, remove former kluge for initializing pg_stat_file()'s pg_proc entry --- bootstrap mode was fixed recently so that this can be done without any hacks, but I overlooked this usage.
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/catalog/system_views.sql33
-rw-r--r--src/backend/utils/adt/genfile.c4
2 files changed, 8 insertions, 29 deletions
diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql
index 2a65b12cff..9dd19e8c5d 100644
--- a/src/backend/catalog/system_views.sql
+++ b/src/backend/catalog/system_views.sql
@@ -3,7 +3,7 @@
*
* Copyright (c) 1996-2006, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/backend/catalog/system_views.sql,v 1.31 2006/09/16 20:14:33 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/catalog/system_views.sql,v 1.32 2006/11/24 21:18:42 tgl Exp $
*/
CREATE VIEW pg_roles AS
@@ -199,10 +199,6 @@ CREATE VIEW pg_stat_all_tables AS
C.oid AS relid,
N.nspname AS schemaname,
C.relname AS relname,
- pg_stat_get_last_vacuum_time(C.oid) as last_vacuum,
- pg_stat_get_last_autovacuum_time(C.oid) as last_autovacuum,
- pg_stat_get_last_analyze_time(C.oid) as last_analyze,
- pg_stat_get_last_autoanalyze_time(C.oid) as last_autoanalyze,
pg_stat_get_numscans(C.oid) AS seq_scan,
pg_stat_get_tuples_returned(C.oid) AS seq_tup_read,
sum(pg_stat_get_numscans(I.indexrelid))::bigint AS idx_scan,
@@ -210,7 +206,11 @@ CREATE VIEW pg_stat_all_tables AS
pg_stat_get_tuples_fetched(C.oid) AS idx_tup_fetch,
pg_stat_get_tuples_inserted(C.oid) AS n_tup_ins,
pg_stat_get_tuples_updated(C.oid) AS n_tup_upd,
- pg_stat_get_tuples_deleted(C.oid) AS n_tup_del
+ pg_stat_get_tuples_deleted(C.oid) AS n_tup_del,
+ pg_stat_get_last_vacuum_time(C.oid) as last_vacuum,
+ pg_stat_get_last_autovacuum_time(C.oid) as last_autovacuum,
+ pg_stat_get_last_analyze_time(C.oid) as last_analyze,
+ pg_stat_get_last_autoanalyze_time(C.oid) as last_autoanalyze
FROM pg_class C LEFT JOIN
pg_index I ON C.oid = I.indrelid
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
@@ -356,24 +356,3 @@ CREATE VIEW pg_stat_database AS
pg_stat_get_db_blocks_hit(D.oid) AS blks_read,
pg_stat_get_db_blocks_hit(D.oid) AS blks_hit
FROM pg_database D;
-
---
--- Fix up built-in functions that make use of OUT parameters.
--- We can't currently fill these values in during bootstrap, because
--- array_in doesn't work in bootstrap mode. Eventually that should be
--- fixed, but for now the path of least resistance is to patch their
--- pg_proc entries later during initdb.
---
-
-UPDATE pg_proc SET
- proallargtypes = ARRAY['text'::regtype,
- 'int8',
- 'timestamptz',
- 'timestamptz',
- 'timestamptz',
- 'timestamptz',
- 'bool'],
- proargmodes = ARRAY['i'::"char", 'o', 'o', 'o', 'o', 'o', 'o'],
- proargnames = ARRAY['filename'::text, 'size', 'access', 'modification',
- 'change', 'creation', 'isdir']
-WHERE oid = 'pg_stat_file(text)'::regprocedure;
diff --git a/src/backend/utils/adt/genfile.c b/src/backend/utils/adt/genfile.c
index cee910f854..38a129783e 100644
--- a/src/backend/utils/adt/genfile.c
+++ b/src/backend/utils/adt/genfile.c
@@ -9,7 +9,7 @@
* Author: Andreas Pflug <pgadmin@pse-consulting.de>
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/genfile.c,v 1.12 2006/11/06 03:06:41 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/genfile.c,v 1.13 2006/11/24 21:18:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -171,7 +171,7 @@ pg_stat_file(PG_FUNCTION_ARGS)
/*
* This record type had better match the output parameters declared for me
- * in pg_proc.h (actually, in system_views.sql at the moment).
+ * in pg_proc.h.
*/
tupdesc = CreateTemplateTupleDesc(6, false);
TupleDescInitEntry(tupdesc, (AttrNumber) 1,