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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

pg_dump and truncate



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;

  1. Execute the following from the Linux shell:

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

 

 

  1. 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



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group