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

initdb should create a warning message [was Re: [ADMIN] Size onDisk]

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org, pgsql-docs(at)postgresql(dot)org
Subject: initdb should create a warning message [was Re: [ADMIN] Size onDisk]
Date: 2003-11-30 22:29:35
Message-ID: 1070231374.7719.2654.camel@linda.lfix.co.uk (view raw or flat)
Thread:
Lists: pgsql-adminpgsql-docspgsql-hackers
On Wed, 2003-11-26 at 05:53, Tom Lane wrote:
> Grzegorz Dostatni <dostatnig(at)yahoo(dot)com> writes:
> > Currently the datase is roughly 80 Megs. About half of
> > the size is stored in pg_xlog directory. I managed to
> > figure out that those files are transaction log files?
> > How can I delete them safely?
> 
> You can NOT.  Don't even think about going there.
> 
> What you can do, if you intend only low-update-volume usage,
> is reduce checkpoint_segments to reduce the number of WAL files
> the system wants to keep around.

The use of the word "log" in the directory name does tend to invite this
error, and some have acted on it without asking first.  I think initdb
should put a README.IMPORTANT file in $PGDATA to say,

        pg_xlog and pg_clog are crucial to the preservation of your
        data. They do not contain standard log files.  Do not even think
        about deleting them to save space; you would destroy your
        database.
        
The cost is only one disk block per cluster, and it might deflect some
of the weaponry pointed at hapless feet...

Patch for initdb.c attached

I notice that pg_clog and pg_xlog are not mentioned in the index to the
documentation, which makes it more difficult for people to find out what
they are.  I therefore also attach a doc patch to add index entries for
those two files.

-- 
Oliver Elphick                                Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight, UK                             http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "Who shall ascend into the hill of the LORD? or who 
      shall stand in his holy place? He that hath clean 
      hands, and a pure heart..."            Psalms 24:3,4 

Attachment: pg_xlog.doc.patch
Description: text/x-patch (2.6 KB)
Attachment: initdb.patch
Description: text/x-patch (1.8 KB)

In response to

Responses

pgsql-docs by date

Next:From: Neil ConwayDate: 2003-11-30 23:18:54
Subject: Re: [HACKERS] initdb should create a warning message [was Re:
Previous:From: Randolf RichardsonDate: 2003-11-29 21:06:00
Subject: Re: 7.4 official docs : Fonts?

pgsql-hackers by date

Next:From: Alex SatrapaDate: 2003-11-30 22:38:06
Subject: Re: Was: Triggers, Stored Procedures, PHP
Previous:From: Joe ConwayDate: 2003-11-30 20:59:45
Subject: Re: Patch queue

pgsql-admin by date

Next:From: Neil ConwayDate: 2003-11-30 23:18:54
Subject: Re: [HACKERS] initdb should create a warning message [was Re:
Previous:From: Christopher BrowneDate: 2003-11-30 00:32:04
Subject: Re: pg_restore and transaction id wraparound

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