pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Gourish Singbal <gourish@gmail.com>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: vacuuming template0 gave ERROR
Date: Mon, 26 Dec 2005 11:02:52 -0500
Message-ID: <9822.1135612972@sss.pgh.pa.us> (raw)
In-Reply-To: <674d1f8a0512260334g3b72c635m7d46ab457a8f2694@mail.gmail.com>
References: <674d1f8a0512260334g3b72c635m7d46ab457a8f2694@mail.gmail.com>

Gourish Singbal <gourish@gmail.com> writes:
> Got the following ERROR when i was vacuuming the template0 database.

Why were you doing that in the first place?  template0 shouldn't ever
be touched.

> postgresql server version is 7.4.5

The underlying cause is likely related to this 7.4.6 bug fix:

2004-10-13 18:22  tgl

	* contrib/pgstattuple/pgstattuple.c,
	src/backend/access/heap/heapam.c,
	src/backend/utils/adt/ri_triggers.c (REL7_4_STABLE): Repair
	possible failure to update hint bits back to disk, per
	http://archives.postgresql.org/pgsql-hackers/2004-10/msg00464.php. 
	I plan a more permanent fix in HEAD, but for the back branches it
	seems best to just touch the places that actually have a problem.


> INFO:  vacuuming "pg_catalog.pg_statistic"
> ERROR:  could not access status of transaction 1107341112
> DETAIL:  could not open file "/home/postgres/data/pg_clog/0420": No such
> file or directory

Fortunately for you, pg_statistic doesn't contain any irreplaceable
data.  So you could get out of this via

	TRUNCATE pg_statistic;
	VACUUM ANALYZE;  -- rebuild contents of pg_statistic
	VACUUM FREEZE;   -- make sure template0 needs no further vacuuming

Then reset template0's datallowconn to false, and get rid of that code
to override it.  And then update to a more recent release ;-)

(I don't recall exactly what rules 7.4 uses, but likely you'll find that
you need to run a standalone backend with -O switch to perform
TRUNCATE on a system catalog.)

			regards, tom lane



view thread (6+ messages)  latest in thread

Message-ID: <9822.1135612972@sss.pgh.pa.us>
Permalink:  ../9822.1135612972@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/9822.1135612972@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, gourish@gmail.com, pgsql-admin@postgresql.org
  Subject: Re: vacuuming template0 gave ERROR
  In-Reply-To: <9822.1135612972@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox