Thread: pg_log directory

pg_log directory

From
"slamp slamp"
Date:
Hi, I am new to this list sorry for asking such a lame question. I
tried searching but did not find the answer i was looking for.

I am running postgresql-8.2.4 on rhel5. Do I need the files in pg_log?
When I look at one of the files, it shows INSERT, UPDATE and SELECT
statements. Reason I asked is because the folder is about 40GB. It is
half the size of my /var/lib/pgsql directory.

Re: pg_log directory

From
Thomas Jacob
Date:
pg_log isn't a standard postgres dir,
so maybe it's where RHEL stores the
actual textual log files that the
server process generated.

Indeed this is suggested here:

http://www.nabble.com/-GENERAL--pg_log-missing-td7753209.html

So if these files look something like:

2008-08-03 00:30:47 CEST LOG:  statement: SELECT col1,col2 FROM table1;
2008-08-03 00:30:47 CEST LOG:  statement: SELECT col FROM table2;

they are just postgres log files, and the server has statement logging
switched on, which is not such a good idea on a busy database.

But if not they might be RHEL names for pg_xlog or pg_clog
and deleting these would be an active attempt to destroy
your database ;-)



On Wed, Aug 20, 2008 at 04:43:06PM -0400, slamp slamp wrote:
> Hi, I am new to this list sorry for asking such a lame question. I
> tried searching but did not find the answer i was looking for.
>
> I am running postgresql-8.2.4 on rhel5. Do I need the files in pg_log?
> When I look at one of the files, it shows INSERT, UPDATE and SELECT
> statements. Reason I asked is because the folder is about 40GB. It is
> half the size of my /var/lib/pgsql directory.
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin

Re: pg_log directory

From
"slamp slamp"
Date:
Thanks, they do look like the lines you have below. I have separate
pg_xlog and pg_clog folders. i'll check the statement logging config,
is this the same as transaction logging?

On Wed, Aug 20, 2008 at 5:02 PM, Thomas Jacob <jacob@internet24.de> wrote:
> pg_log isn't a standard postgres dir,
> so maybe it's where RHEL stores the
> actual textual log files that the
> server process generated.
>
> Indeed this is suggested here:
>
> http://www.nabble.com/-GENERAL--pg_log-missing-td7753209.html
>
> So if these files look something like:
>
> 2008-08-03 00:30:47 CEST LOG:  statement: SELECT col1,col2 FROM table1;
> 2008-08-03 00:30:47 CEST LOG:  statement: SELECT col FROM table2;
>
> they are just postgres log files, and the server has statement logging
> switched on, which is not such a good idea on a busy database.
>
> But if not they might be RHEL names for pg_xlog or pg_clog
> and deleting these would be an active attempt to destroy
> your database ;-)
>
>
>
> On Wed, Aug 20, 2008 at 04:43:06PM -0400, slamp slamp wrote:
>> Hi, I am new to this list sorry for asking such a lame question. I
>> tried searching but did not find the answer i was looking for.
>>
>> I am running postgresql-8.2.4 on rhel5. Do I need the files in pg_log?
>> When I look at one of the files, it shows INSERT, UPDATE and SELECT
>> statements. Reason I asked is because the folder is about 40GB. It is
>> half the size of my /var/lib/pgsql directory.
>>
>> --
>> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-admin
>

Re: pg_log directory

From
Tom Lane
Date:
"slamp slamp" <slackamp@gmail.com> writes:
> I am running postgresql-8.2.4 on rhel5. Do I need the files in pg_log?
> When I look at one of the files, it shows INSERT, UPDATE and SELECT
> statements. Reason I asked is because the folder is about 40GB. It is
> half the size of my /var/lib/pgsql directory.

That's just the server message log.  While you could blow away the files
without any ill effect, soon enough you'd have another 40GB.  You need
to either dial down the verbosity of your what-to-log settings, or
modify the where-to-log settings to recycle log files more frequently,
or both.  In particular it sounds like you have set log_statement = all
without, perhaps, understanding the consequences.  Read the fine manual
here:
http://www.postgresql.org/docs/8.2/static/runtime-config-logging.html

            regards, tom lane

Re: pg_log directory

From
"slamp slamp"
Date:
On Wed, Aug 20, 2008 at 9:38 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> That's just the server message log.  While you could blow away the files
> without any ill effect, soon enough you'd have another 40GB.  You need
> to either dial down the verbosity of your what-to-log settings, or
> modify the where-to-log settings to recycle log files more frequently,
> or both.  In particular it sounds like you have set log_statement = all
> without, perhaps, understanding the consequences.  Read the fine manual
> here:
> http://www.postgresql.org/docs/8.2/static/runtime-config-logging.html
>
>                        regards, tom lane
>

I am using the PGDG rpms. So it has the default logging configs. its
rotating daily but i have files there since 2007. is there a config
option to delete these files? i looked at the manual and i guess i
must be missing the option i want.

Re: pg_log directory

From
Tom Lane
Date:
"slamp slamp" <slackamp@gmail.com> writes:
> I am using the PGDG rpms. So it has the default logging configs. its
> rotating daily but i have files there since 2007.

With the RPM's logging config you should only have seven daily log files
in pg_log.  Could we see an ls -l of the pg_log directory?

            regards, tom lane

Re: pg_log directory

From
Devrim GÜNDÜZ
Date:
On Thu, 2008-08-21 at 09:25 -0400, slamp slamp wrote:
>
> I am using the PGDG rpms. So it has the default logging configs. its
> rotating daily but i have files there since 2007. is there a config
> option to delete these files?

You may want to change log_filename option, and set it to (for example)
"postgresql-%a.log"  so that ogs will be rotated weekly.

Actually this is what I'm planning to do for 8.4+ PGDG RPMs.

Regards,
--
Devrim GÜNDÜZ
devrim~gunduz.org, devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
                   http://www.gunduz.org


Attachment

Re: pg_log directory

From
Devrim GÜNDÜZ
Date:
On Thu, 2008-08-21 at 10:02 -0400, Tom Lane wrote:
> With the RPM's logging config you should only have seven daily log
> files in pg_log.

This is not valid for PGDG RPMs :) As I wrote, it will be in 8.4 set.
>
--
Devrim GÜNDÜZ
devrim~gunduz.org, devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
                   http://www.gunduz.org


Attachment