pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg_log directory
8+ messages / 4 participants
[nested] [flat]

* pg_log directory
@ 2008-08-20 20:43  slamp slamp <slackamp@gmail.com>
  0 siblings, 2 replies; 8+ messages in thread

From: slamp slamp @ 2008-08-20 20:43 UTC (permalink / raw)
  To: pgsql-admin

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.



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: pg_log directory
@ 2008-08-20 21:02  Thomas Jacob <jacob@internet24.de>
  parent: slamp slamp <slackamp@gmail.com>
  1 sibling, 1 reply; 8+ messages in thread

From: Thomas Jacob @ 2008-08-20 21:02 UTC (permalink / raw)
  To: pgsql-admin; +Cc: slamp slamp <slackamp@gmail.com>

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



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: pg_log directory
@ 2008-08-21 00:08  slamp slamp <slackamp@gmail.com>
  parent: Thomas Jacob <jacob@internet24.de>
  0 siblings, 0 replies; 8+ messages in thread

From: slamp slamp @ 2008-08-21 00:08 UTC (permalink / raw)
  To: pgsql-admin

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
>



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: pg_log directory
@ 2008-08-21 01:38  Tom Lane <tgl@sss.pgh.pa.us>
  parent: slamp slamp <slackamp@gmail.com>
  1 sibling, 1 reply; 8+ messages in thread

From: Tom Lane @ 2008-08-21 01:38 UTC (permalink / raw)
  To: slamp slamp <slackamp@gmail.com>; +Cc: pgsql-admin

"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



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: pg_log directory
@ 2008-08-21 13:25  slamp slamp <slackamp@gmail.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 2 replies; 8+ messages in thread

From: slamp slamp @ 2008-08-21 13:25 UTC (permalink / raw)
  To: pgsql-admin

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.



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: pg_log directory
@ 2008-08-21 14:02  Tom Lane <tgl@sss.pgh.pa.us>
  parent: slamp slamp <slackamp@gmail.com>
  1 sibling, 1 reply; 8+ messages in thread

From: Tom Lane @ 2008-08-21 14:02 UTC (permalink / raw)
  To: slamp slamp <slackamp@gmail.com>; +Cc: pgsql-admin

"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



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: pg_log directory
@ 2008-08-23 14:05  Devrim GÜNDÜZ <devrim@gunduz.org>
  parent: slamp slamp <slackamp@gmail.com>
  1 sibling, 0 replies; 8+ messages in thread

From: Devrim GÜNDÜZ @ 2008-08-23 14:05 UTC (permalink / raw)
  To: slamp slamp <slackamp@gmail.com>; +Cc: pgsql-admin

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

Attachments:

  signature.asc (application/pgp-signature, 196B) download

^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: pg_log directory
@ 2008-08-23 14:07  Devrim GÜNDÜZ <devrim@gunduz.org>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 8+ messages in thread

From: Devrim GÜNDÜZ @ 2008-08-23 14:07 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: slamp slamp <slackamp@gmail.com>; pgsql-admin

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

Attachments:

  signature.asc (application/pgp-signature, 196B) download

^ permalink  raw  reply  [nested|flat] 8+ messages in thread


end of thread, other threads:[~2008-08-23 14:07 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-08-20 20:43 pg_log directory slamp slamp <slackamp@gmail.com>
2008-08-20 21:02 ` Thomas Jacob <jacob@internet24.de>
2008-08-21 00:08   ` slamp slamp <slackamp@gmail.com>
2008-08-21 01:38 ` Tom Lane <tgl@sss.pgh.pa.us>
2008-08-21 13:25   ` slamp slamp <slackamp@gmail.com>
2008-08-21 14:02     ` Tom Lane <tgl@sss.pgh.pa.us>
2008-08-23 14:07       ` Devrim GÜNDÜZ <devrim@gunduz.org>
2008-08-23 14:05     ` Devrim GÜNDÜZ <devrim@gunduz.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox