Skip site navigation (1) Skip section navigation (2)

Patch to remove sort files, temp tables, unreferenced files

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Patch to remove sort files, temp tables, unreferenced files
Date: 2001-05-28 19:17:32
Message-ID: 200105281917.f4SJHW616700@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-patches
The following patch does full referential checking of sort files, temp
tables, and table files.  It checks references of every file and temp
table, and reports or removes it.  The code only removes files it is
certain about.

A typical output report is:

test=> VACUUM; 
NOTICE:  Unusual file found in temporary sort directory.  This file is not
         normally created by PostgreSQL and can be removed by the
         administrator using 'rm':
         /usr/var/local/postgres/data/base/18617/pg_sorttemp/x
NOTICE:  Unusual file found in database directory.  This file is not
         normally created by PostgreSQL and can be removed by the
         administrator using 'rm':
         /usr/var/local/postgres/data/base/18617/x
NOTICE:  Core file found in database directory.  If you don't need it
         for debugging, the administrator can remove it using 'rm':
         /usr/var/local/postgres/data/base/18617/core
NOTICE:  Unreferenced table file found in database directory.  This
         could have been left from a database crash.  If no one was
         using the database during VACUUM, the file can be safely
         removed by the administrator using 'rm':
         /usr/var/local/postgres/data/base/18617/33333


Most of the work is done as part of a full database VACUUM.  Postmaster
startup also cleans all sort files.

It uses a SnapshotAny read of pg_class to find referenced files.  It
does not use Oid ranges anymore.

I also had to add ShmemPIDAdd() and redo ShmemPIDLookup() because the
ShmemPIDLookup() API was weird.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Responses

pgsql-patches by date

Next:From: Ian Lance TaylorDate: 2001-05-28 22:47:24
Subject: Re: [HACKERS] Support for %TYPE in CREATE FUNCTION
Previous:From: Bruce MomjianDate: 2001-05-28 14:15:23
Subject: Re: [HACKERS] Support for %TYPE in CREATE FUNCTION

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group