Re:

From: Clayton Cottingham <drfrog(at)smartt(dot)com>
To: Martin Neumann <lists(at)mne(dot)de>, "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re:
Date: 1999-09-02 09:59:47
Message-ID: 37CE4A90.9831D625@smartt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

martin:
couple o things:

use something like sed to pre process the file taking out the erronous
data, if you know what the bad data is

one thing i use sed for is html escape single quotes and the like,

it should work well for you

the regex for substituting like that is:
s/old/new/g

the sed command operates regexes with an -e switch :

sed -e s/error/correction/g errorfile>correctedfile
takes errorfile in and changes any occurence of 'error' to 'correction'
and
prints all data to correctedfile

also if its a flat file you could just use the copy command in psql
instead of inserts:

\copy tablein from filename

In response to

  • at 1999-09-02 06:04:24 from Martin Neumann

Browse pgsql-sql by date

  From Date Subject
Next Message Tim Pizey 1999-09-02 10:26:34 Re: [SQL] Newbie dbadmin out of his league
Previous Message Esteban Chiner Sanz 1999-09-02 08:30:10 Max function on Timestamp