Re: [HACKERS] pg_dump not dumping all tables - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: [HACKERS] pg_dump not dumping all tables
Date
Msg-id 379FEEDC.11FFBD7@trust.ee
Whole thread Raw
In response to Re: [HACKERS] pg_dump not dumping all tables  (The Hermit Hacker <scrappy@hub.org>)
List pgsql-hackers
The Hermit Hacker wrote:
> 
> On Wed, 28 Jul 1999, G. Anthony Reina wrote:
> 
> > Again, the text file is over 2 Gig so I can't seem to find an editor that is
> > big enough to hold it all in memory (I only have a half a gig of RAM). So it
> > really is just guesswork. Anything you can think of to strip the data from
> > this big of a file?
> 
> egrep "^CREATE|^COPY" <filename> ?

Nay,we have currently nice multi-line CREATEs.

the following python script should to work

------------------------------------------------------
#!/usr/bin/env python
import sys
in_data = 0
while 1:   line = sys.stdin.readline()   if not line: break   if line[:5] == 'COPY ':       in_data = 1   if not
in_data:sys.stdout.write(line)   if in_data and line[:2] == '\\.':       in_data = 0
 
-----------------------------------------------------

as you can probably guess it is used as 

stripdata.py <withdata.sql >withoutdata.sql

-------------------------
Hannu


pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: Selectivity of "=" (Re: [HACKERS] Index not used on simple se lect)
Next
From: "Hiroshi Inoue"
Date:
Subject: RE: [HACKERS] double opens