Thread: Addendum to the FAQ

Addendum to the FAQ

From
"Andreas 'ads' Scherbaum"
Date:

Hello,

based on a common question, here is an addendum for the FAQ:

Question: The files in pg_xlog/* take up a lot of disk space, can they be removed?

Answer:

Under no circumstances must files in the pg_xlog/ directory be removed, they are essential for the database operation. The files in this directory store the transaction log, without these files the database can't recover after a crash or shutdown.

The size of the pg_xlog/ directory can be configured by setting the "min_wal_size" and "max_wal_size" GUC (PostgreSQL 9.5 and newer), or by setting the "checkpoint_segments" GUC (9.4 and earlier).
https://www.postgresql.org/docs/current/static/runtime-config-wal.html
https://www.postgresql.org/docs/9.4/static/runtime-config-wal.html


Regards,

--
Andreas 'ads' Scherbaum
German PostgreSQL User Group
European PostgreSQL User Group - Board of Directors
Volunteer Regional Contact, Germany - PostgreSQL Project

Re: Addendum to the FAQ

From
"Bradley DeJong"
Date:
On 2018-09-29, Andreas 'ads' Scherbaum wrote ...
> Answer:
> Under no circumstances must files in the pg_xlog/ directory be removed, they are essential
> for the database operation. The files in this directory store the transaction log, without
> these files the database can't recover after a crash or shutdown.

Those sentences use a fairly sophisticated/complex sentence structure.
As a simplified alternative, I suggest ...

Answer:
Do not remove any files from the pg_xlog directory. They store the transaction log. Without
the transaction log, the database can't recover after a crash or shutdown.

Re: Addendum to the FAQ

From
Bruce Momjian
Date:
On Sun, Sep 30, 2018 at 12:20:02PM +0000, Bradley DeJong wrote:
> On 2018-09-29, Andreas 'ads' Scherbaum wrote ...
> > Answer:
> > Under no circumstances must files in the pg_xlog/ directory be removed, they
> are essential
> > for the database operation. The files in this directory store the transaction
> log, without
> > these files the database can't recover after a crash or shutdown.
> 
> Those sentences use a fairly sophisticated/complex sentence structure.
> As a simplified alternative, I suggest ...
> 
> Answer:
> Do not remove any files from the pg_xlog directory. They store the transaction
> log. Without
> the transaction log, the database can't recover after a crash or shutdown.

Now that the directory is named pg_wal in PG 10, we might not need this.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +


Re: Addendum to the FAQ

From
Christophe Pettus
Date:

> On Oct 15, 2018, at 10:49, Bruce Momjian <bruce@momjian.us> wrote:
> Now that the directory is named pg_wal in PG 10, we might not need this.

I wish I could say that, but we just had a client ask if they could do exactly that, on 10...

--
-- Christophe Pettus
   xof@thebuild.com



Re: Addendum to the FAQ

From
Bruce Momjian
Date:
On Mon, Oct 15, 2018 at 10:52:33AM -0700, Christophe Pettus wrote:
> 
> 
> > On Oct 15, 2018, at 10:49, Bruce Momjian <bruce@momjian.us> wrote:
> > Now that the directory is named pg_wal in PG 10, we might not need this.
> 
> I wish I could say that, but we just had a client ask if they could do exactly that, on 10...

Oh, even after the rename!

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +


Re: Addendum to the FAQ

From
Steve Atkins
Date:

> On Oct 15, 2018, at 6:55 PM, Bruce Momjian <bruce@momjian.us> wrote:
>
> On Mon, Oct 15, 2018 at 10:52:33AM -0700, Christophe Pettus wrote:
>>
>>
>>> On Oct 15, 2018, at 10:49, Bruce Momjian <bruce@momjian.us> wrote:
>>> Now that the directory is named pg_wal in PG 10, we might not need this.
>>
>> I wish I could say that, but we just had a client ask if they could do exactly that, on 10...
>
> Oh, even after the rename!

Yup. Same here, just a few days ago.

Cheers,
  Steve

Re: Addendum to the FAQ

From
Andreas 'ads' Scherbaum
Date:
On 15.10.18 19:55, Bruce Momjian wrote:
> On Mon, Oct 15, 2018 at 10:52:33AM -0700, Christophe Pettus wrote:
>>
>>> On Oct 15, 2018, at 10:49, Bruce Momjian <bruce@momjian.us> wrote:
>>> Now that the directory is named pg_wal in PG 10, we might not need this.
>> I wish I could say that, but we just had a client ask if they could do exactly that, on 10...
> Oh, even after the rename!

Ran into a similar case, someone asked why the pg_wal directory uses 
half a GB of disk space, and if it can be removed.

Given that "pg_xlog" versions are still supported, I propose the 
following updated FAQ entry:



Question: The files in pg_xlog/* or pg_wal/* take up a lot of disk 
space, can they be removed?

Answer:

Under no circumstances must files in the pg_xlog/ (up to PostgreSQL 9.6) 
or pg_wal/ (beginning PostgreSQL 10) directory be removed, they are 
essential for the database operation. The files in this directory store 
the transaction logs, without these files the database can't recover 
after a crash or shutdown.

The size of the pg_xlog/ or pg_wal/ directory can be configured by 
setting the "min_wal_size" and "max_wal_size" GUC (PostgreSQL 9.5 and 
newer), or by setting the "checkpoint_segments" GUC (PostgreSQL 9.4 and 
earlier).
https://www.postgresql.org/docs/current/static/runtime-config-wal.html
https://www.postgresql.org/docs/9.4/static/runtime-config-wal.html



Regards,

-- 
                Andreas 'ads' Scherbaum
German PostgreSQL User Group
European PostgreSQL User Group - Board of Directors
Volunteer Regional Contact, Germany - PostgreSQL Project