Thread: pg_xlog question

pg_xlog question

From
Pam Wampler
Date:
Questions on pg_xlog:

1.  what parameter tells postgress to always keep 7 files in the pg_xlog
directory? (see below) --this is test database we
are learning on. (and it seems everytime that I look at this directory there
are always 7 entries there)

2.  What happens when the files increment and can no longer increment to a
higher number (the file name)?

3.  Is there a way to "reset" the number so that this won't happen?


total 114800
-rw-------  1 pgsql  pgsql  16777216 May  6 19:07 00000009000000CC
-rw-------  1 pgsql  pgsql  16777216 May  6 19:08 00000009000000CD
-rw-------  1 pgsql  pgsql  16777216 May  6 19:09 00000009000000CE
-rw-------  1 pgsql  pgsql  16777216 May  7 08:23 00000009000000CF
-rw-------  1 pgsql  pgsql  16777216 May  7 08:25 00000009000000D0
-rw-------  1 pgsql  pgsql  16777216 May 22 10:32 00000009000000D1
-rw-------  1 pgsql  pgsql  16777216 Jul  9 16:23 00000009000000CB
$ pwd
/usr/local/pgsql/data/pg_xlog
$

Thank you
Pam Wampler






Re: pg_xlog question

From
Tom Lane
Date:
Pam Wampler <Pam_Wampler@taylorwhite.com> writes:
> 1.  what parameter tells postgress to always keep 7 files in the pg_xlog
> directory? (see below) --this is test database we
> are learning on. (and it seems everytime that I look at this directory there
> are always 7 entries there)

It's basically 2 * checkpoint_segments + 1.  See
http://www.ca.postgresql.org/users-lounge/docs/7.2/postgres/wal-configuration.html

> 2.  What happens when the files increment and can no longer increment to a
> higher number (the file name)?

Trouble, which is why we use a 64-bit counter.

> 3.  Is there a way to "reset" the number so that this won't happen?

initdb.  However, you're not gonna have to worry about it in your
lifetime.  Do the math...

            regards, tom lane