X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id CA54BD1B1A5 for ; Fri, 9 Jul 2004 08:23:17 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 31342-06 for ; Fri, 9 Jul 2004 11:23:17 +0000 (GMT) Received: from lorraine.ipl.co.uk (lorraine.ipl.co.uk [195.112.52.123]) by svr1.postgresql.org (Postfix) with ESMTP id DCA84D1B169 for ; Fri, 9 Jul 2004 08:23:11 -0300 (ADT) Received: from HFPORT.dmr.co.uk (pennsoft.gotadsl.co.uk [81.6.232.68]) by lorraine.ipl.co.uk (8.12.9/8.12.9) with ESMTP id i69BMwMT015284; Fri, 9 Jul 2004 12:23:02 +0100 Message-Id: <5.1.0.14.0.20040709122158.055ac630@mailserver.dmr.co.uk> X-Sender: hf1@mailserver.dmr.co.uk X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Fri, 09 Jul 2004 12:25:39 +0100 To: Stef From: Hilary Forbes Subject: Re: Bad dumps... Cc: pgsql-admin@postgresql.org 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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/115 X-Sequence-Number: 14183 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 **********************************************************