pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hilary Forbes <hforbes@dmr.co.uk>
To: Stef <svb@ucs.co.za>
Cc: pgsql-admin@postgresql.org
Subject: Re: Bad dumps...
Date: Fri, 09 Jul 2004 12:25:39 +0100
Message-ID: <5.1.0.14.0.20040709122158.055ac630@mailserver.dmr.co.uk> (raw)
In-Reply-To: <20040709130331.7c81e2ab@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>

Can we go back to the beginning here?!  If you are doing updates to remove the \N, why are you allowing them to get into the database in the first place?  Why not get rid of them in your UPDATE statement using the replace statement in the first place (or dealing with them in your source application before invoking postgres).

Maybe I'm missing the point here!

Hilary

At 13:03 09/07/2004 +0200, you wrote:

>Hilary Forbes mentioned :
>=> This is very similar to my problem with the ascii code 13s when I dumped and couldn't load the dumped data.  What I did was to write a short script replaced the offending characters with an empty string which is different to NULL.  The other alternative is to have
>
>This sounds like a possible solution, but
>people actually insert the two characters : '\' and 'N' 
>as '\N' into this column, which is not null, but is seen
>as null by the COPY statement during import. I'm
>just not happy about the fact that literal and valid '\N' 
>values become null next time I import the database.
>
>At the moment I'm doing this :
>update person set per_id_no = '' where per_id_no like '%\N%';
>
>I can also clean  the data for this specific column before insertion,
>but not for all other columns in the database where this could possibly happen.
>
>Can I change pg_dump behaviour to dump nulls as a series of characters
>of my choice (as in the COPY statement) and then pg_restore to interpret this 
>correctly when importing?
>
>TIA
>Stefan

Hilary Forbes
The DMR Information and Technology Group  (www.dmr.co.uk)
Direct tel 01689 889950 Fax 01689 860330 
DMR is a UK registered trade mark of DMR Limited
**********************************************************




view thread (10+ messages)  latest in thread

Message-ID: <5.1.0.14.0.20040709122158.055ac630@mailserver.dmr.co.uk>
Permalink:  ../5.1.0.14.0.20040709122158.055ac630@mailserver.dmr.co.uk/
Also on:    postgresql.org/message-id/5.1.0.14.0.20040709122158.055ac630@mailserver.dmr.co.uk

 · 

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: hforbes@dmr.co.uk, svb@ucs.co.za
  Subject: Re: Bad dumps...
  In-Reply-To: <5.1.0.14.0.20040709122158.055ac630@mailserver.dmr.co.uk>
  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>

* 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