Thread: How to erase transaction logs on PostgreSQL

How to erase transaction logs on PostgreSQL

From
Frank Church
Date:
How do you purge the postgresql transaction log?

I am creating a virtual machine image and I want to erase any transaction logs that got built up during development. What is the way to do that?

I am currently using 8.3 and 8.4.

Is there the possibility that the logs saved in /var/log also contain security details?

/voipfc

Re: How to erase transaction logs on PostgreSQL

From
Guillaume Lelarge
Date:
On Thu, 2012-03-08 at 10:18 +0000, Frank Church wrote:
> How do you purge the postgresql transaction log?
>

You don't. PostgreSQL does it for you.

> I am creating a virtual machine image and I want to erase any transaction
> logs that got built up during development. What is the way to do that?
>
> I am currently using 8.3 and 8.4.
>
> Is there the possibility that the logs saved in /var/log also contain
> security details?
>

The only security detail AFAIK would be passwords (if you set a password
and log queries, the password will be in the logs... the only way to
prevent that is to send it crypted).


--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com


Re: How to erase transaction logs on PostgreSQL

From
Achilleas Mantzios
Date:
one ultra dummy way would be to dump, back up, destroy the data dirs,
and any human /var/log files and then re-initdb and restore.

On Πεμ 08 Μαρ 2012 12:18:17 Frank Church wrote:
> How do you purge the postgresql transaction log?
>
> I am creating a virtual machine image and I want to erase any transaction
> logs that got built up during development. What is the way to do that?
>
> I am currently using 8.3 and 8.4.
>
> Is there the possibility that the logs saved in /var/log also contain
> security details?
>
> /voipfc

--
Achilleas Mantzios
IT DEPT

Re: How to erase transaction logs on PostgreSQL

From
Guillaume Lelarge
Date:
On Fri, 2012-03-09 at 00:09 +0000, Frank Church wrote:
>
>
> On 8 March 2012 16:23, Guillaume Lelarge <guillaume@lelarge.info>
> wrote:
>         On Thu, 2012-03-08 at 10:18 +0000, Frank Church wrote:
>         > How do you purge the postgresql transaction log?
>         >
>
>
>         You don't. PostgreSQL does it for you.
>
>         > I am creating a virtual machine image and I want to erase
>         any transaction
>         > logs that got built up during development. What is the way
>         to do that?
>         >
>         > I am currently using 8.3 and 8.4.
>         >
>         > Is there the possibility that the logs saved in /var/log
>         also contain
>         > security details?
>         >
>
>
>         The only security detail AFAIK would be passwords (if you set
>         a password
>         and log queries, the password will be in the logs... the only
>         way to
>         prevent that is to send it crypted).
>
>
>
> What are the commands to accomplish that, ie getting PostgreSQL to
> erase the logs?
>

PostgreSQL doesn't erase logs. You need to do it yourself, either
manually or with a script (executed by cron for example).


--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com


Re: How to erase transaction logs on PostgreSQL

From
Simon Riggs
Date:
On Thu, Mar 8, 2012 at 10:18 AM, Frank Church <voipfc@gmail.com> wrote:
> How do you purge the postgresql transaction log?
>
> I am creating a virtual machine image and I want to erase any transaction
> logs that got built up during development. What is the way to do that?

pg_resetxlog

> I am currently using 8.3 and 8.4.
>
> Is there the possibility that the logs saved in /var/log also contain
> security details?

I suggest you delete them.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

Re: How to erase transaction logs on PostgreSQL

From
Frank Church
Date:


On 8 March 2012 16:23, Guillaume Lelarge <guillaume@lelarge.info> wrote:
On Thu, 2012-03-08 at 10:18 +0000, Frank Church wrote:
> How do you purge the postgresql transaction log?
>

You don't. PostgreSQL does it for you.

> I am creating a virtual machine image and I want to erase any transaction
> logs that got built up during development. What is the way to do that?
>
> I am currently using 8.3 and 8.4.
>
> Is there the possibility that the logs saved in /var/log also contain
> security details?
>

The only security detail AFAIK would be passwords (if you set a password
and log queries, the password will be in the logs... the only way to
prevent that is to send it crypted).



What are the commands to accomplish that, ie getting PostgreSQL to erase the logs?

 
--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com


Re: How to erase transaction logs on PostgreSQL

From
John R Pierce
Date:
On 03/08/12 4:09 PM, Frank Church wrote:
> What are the commands to accomplish that, ie getting PostgreSQL to
> erase the logs?

there's two completely different sorts of logs here.   'transaction
logs' in postgres are the write-ahead logs, these are binary files used
internally by postgres, in the pg_xlog directory, as Simon said, you can
use pg_resetxlog() to 'reset' the state of this.

the other sort of logs are the human readable log files, generated for
debugging and auditing purposes, these contain just what you configure
them to contain, and are often stored in pg_log, or in the system logs
(/var/log/...)  depending on your configuration.  you'd have to delete
these yourself outside of postgres.

--
john r pierce                            N 37, W 122
santa cruz ca                         mid-left coast