Skip site navigation (1) Skip section navigation (2)

pg_dump and truncate

From: "Feng Chen" <fchen(at)covergence(dot)com>
To: <pgsql-bugs(at)postgresql(dot)org>
Subject: pg_dump and truncate
Date: 2007-02-21 19:56:38
Message-ID: 0D1719326D64BD4E9F92A0C12023767801B2D5DF@eserv.covergence.com (view raw or flat)
Thread:
Lists: pgsql-bugs
Hello there,

 

I was trying to do a live db archive using the following steps:

 

1.	Open a connection to the database;
2.	With the connection, do the following:

BEGIN;

SET transaction ISOLATION level SERIALIZABLE;

3.	Execute the following from the Linux shell:

pg_dump dbname | gzip -9 > dbname-archive.gz

 

 

4.	With the same connection, do the following:

truncate table1, table2,...;

end;

 

Well, the tables are truncated all right, but the db dump file is
empty!!!

 

What went wrong with my logic? What should be the correct procedure?


Thank you!


Feng

Responses

pgsql-bugs by date

Next:From: Aaron ZedonisDate: 2007-02-21 20:57:14
Subject: BUG #3049: psql does not honor md5 in pg_hba.conf file
Previous:From: Dmitry KoterovDate: 2007-02-21 16:20:42
Subject: BUG #3048: pg_dump dumps intarray metadata incorrectly

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group