pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stef <svb@ucs.co.za>
To: pgsql-admin@postgresql.org
Subject: Re: Bad dumps...
Date: Tue, 13 Jul 2004 12:40:00 +0200
Message-ID: <20040713124000.49a556a0@svb.ucs.co.za> (raw)
In-Reply-To: <20040712095203.333c8aa2@svb.ucs.co.za>
References: <5.1.0.14.0.20040709093611.05621ea0@mailserver.dmr.co.uk>
	<20040709095738.5738334f@svb.ucs.co.za>
	<5.1.0.14.0.20040709093611.05621ea0@mailserver.dmr.co.uk>
	<5.1.0.14.0.20040709122158.055ac630@mailserver.dmr.co.uk>
	<20040709161641.3e164d8f@svb.ucs.co.za>
	<1089429340.10763.10.camel@localhost.localdomain>
	<20040712095203.333c8aa2@svb.ucs.co.za>

I found that it was actually a '\\N' value only that causes 
dumps to dump successfully, but fail on import (When using COPY),
because both '\N' and '\\N' are seen as null by the COPY statement.
I just happened to have '\\N' values in my NOT NULL text field.
I now manually use this dump command :
pg_dump  | sed 's:\\\\N:¬:g' | gzip > dump.gz

and do the reverse sed to restore.

Stef mentioned :
=> mike g mentioned :
=> => That could be a bug.  How are you dumping the data?  pg_dump?  Select
=> => query?  How are you restoring the data?  psql?  
=> 
=> Dumping:
=> pg_dump -Ft | gzip > dump.tgz
=> 
=> Restoring:
=> zcat dump.tgz | pg_restore -Ft |psql
=> OR
=> tar xvfz dump.tgz
=> perl -pi -e 's/\$\$PATH\$\$/$ENV{PWD}/g' restore.sql
=> psql -f restore.sql
=> 
=> Both these methods, produce the same result.
=> 

view thread (10+ messages)  latest in thread

Message-ID: <20040713124000.49a556a0@svb.ucs.co.za>
Permalink:  ../20040713124000.49a556a0@svb.ucs.co.za/
Also on:    postgresql.org/message-id/20040713124000.49a556a0@svb.ucs.co.za

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: svb@ucs.co.za
  Subject: Re: Bad dumps...
  In-Reply-To: <20040713124000.49a556a0@svb.ucs.co.za>
  References: <5.1.0.14.0.20040709093611.05621ea0@mailserver.dmr.co.uk> <20040709095738.5738334f@svb.ucs.co.za> <5.1.0.14.0.20040709122158.055ac630@mailserver.dmr.co.uk> <20040709161641.3e164d8f@svb.ucs.co.za> <1089429340.10763.10.camel@localhost.localdomain> <20040712095203.333c8aa2@svb.ucs.co.za> <20040713124000.49a556a0@svb.ucs.co.za>

* 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