Thread: pg_log

pg_log

From
Alvaro Herrera
Date:
Hi all

I'm running PG 7.0.3 on Linux. I have a single database, three hundred
tables, 70 MB in all -- not too much.

However, one table get one record updated per second. I vacuum it
regularly, so it doesn't grow too big. Problem is, pg_log seems to get
bigger and bigger and doesn't shrink, no matter what I do.

ARAIK, pg_log records which tuples are "active" and which ones are
obsolete, so I'm not going to delete it. I just want to know if there is
a way to reduce its size. Right now, it's 178 MB -- more than twice the
database itself (no, I don't have any other databases besides template1
and such). I know I can dump and restore from a clean (empty) install,
but is there a simpler way?

TIA.

--
Alvaro Herrera (<alvherre[@]protecne.cl>)


Re: pg_log

From
Tom Lane
Date:
Alvaro Herrera <alvherre@protecne.cl> writes:
> ARAIK, pg_log records which tuples are "active" and which ones are
> obsolete, so I'm not going to delete it.

Actually, it records which transactions committed and which didn't.
So, you can slow the rate of growth of pg_log if you can reduce the
number of transactions used.  Consider wrapping sequences of operations
into begin/end blocks.

> I know I can dump and restore from a clean (empty) install,
> but is there a simpler way?

Afraid not.  pg_log is critical data.

            regards, tom lane