Re: Truncate on pg_dump / pg_restore

From: Bryce Nesbitt <bryce2(at)obviously(dot)com>
To: chris smith <dmagick(at)gmail(dot)com>, sql pgsql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Truncate on pg_dump / pg_restore
Date: 2008-10-25 15:23:46
Message-ID: 49033A02.4040109@obviously.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<br>
chris smith wrote:
<blockquote
cite="mid:3c1395330810250318r6f4c7e1ao9eac8dd35eed2726(at)mail(dot)gmail(dot)com"
type="cite">
<pre wrap="">On Sat, Oct 25, 2008 at 5:32 PM, Bryce Nesbitt <a class="moz-txt-link-rfc2396E" href="mailto:bryce2(at)obviously(dot)com">&lt;bryce2(at)obviously(dot)com&gt;</a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">I've got
tables with pretty disposable data... meaning I want to drop the data...
but restore empty indexed tables at pg_restore time.
</pre>
</blockquote>
<pre wrap=""><!---->
Do a schema-only dump.
pg_dump --help says use '-s' or '--schema-only'.
</pre>
</blockquote>
Ooops, I was unclear.  I want most of the data!  There are just a few
tables that I'd prefer be empty (truncated) in the restored database. 
Most of the tables (and there are lots) are valuable.<br>
<br>
Could I  dump --schema-only, dump full, dump the toc, comment out the
tables from the toc, restore the --schema-only, then restore the dump
(minus the contents of the unwanted tables)?<br>
<br>
</body>
</html>

Attachment Content-Type Size
unknown_filename text/html 1.2 KB

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Harold A. Giménez Ch. 2008-10-25 15:36:08 Re: Truncate on pg_dump / pg_restore
Previous Message chris smith 2008-10-25 10:18:30 Re: Truncate on pg_dump / pg_restore