pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hannu Krosing <hannu@trust.ee>
To: The Hermit Hacker <scrappy@hub.org>
Cc: G. Anthony Reina <reina@nsi.edu>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgreSQL.org
Subject: Re: [HACKERS] pg_dump not dumping all tables
Date: Thu, 29 Jul 1999 09:04:12 +0300
Message-ID: <379FEEDC.11FFBD7@trust.ee> (raw)
References: <Pine.BSF.4.10.9907282327450.65827-100000@thelab.hub.org>

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



view thread (10+ messages)

Message-ID: <379FEEDC.11FFBD7@trust.ee>
Permalink:  ../379FEEDC.11FFBD7@trust.ee/
Also on:    postgresql.org/message-id/379FEEDC.11FFBD7@trust.ee

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: hannu@trust.ee, scrappy@hub.org, reina@nsi.edu, tgl@sss.pgh.pa.us
  Subject: Re: [HACKERS] pg_dump not dumping all tables
  In-Reply-To: <379FEEDC.11FFBD7@trust.ee>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox