Re: [HACKERS] Invalid unicode in COPY problem

From: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: [HACKERS] Invalid unicode in COPY problem
Date: 2005-05-08 09:18:17
Message-ID: 20050508111817.D591@hermes.hilbert.loc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

> There is a table t1(member_id integer primary key, member_name text,
> address text, phone text, email text). I have to reach each member by
> either adress, phone or email. Unfortunately some of address field
> have wrong encoded data. In this case I will use phone or email to
> reach them.
>
> Now I need to upgrade to newer PostgreSQL within 1 day. I know I have
> to fix wrong encoded field but it will take more than 1 day. So I
> would like to import the data first then fix wrong encoded field on
> running database since I can reach members by phone or email even with
> wrong encoded address field...
You could add a bytea field in the migration process which
holds the original data and put some "sloppily corrected" data
inside the real field for the time being. Then, once corrected
set the additional bytea field to NULL. Pretty much the
concept of staging tables for data import.

Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Ben-Nes 2005-05-08 10:30:16 Re: SQL History
Previous Message Karsten Hilbert 2005-05-08 09:15:43 Re: [HACKERS] Invalid unicode in COPY problem

Browse pgsql-hackers by date

  From Date Subject
Next Message Devrim GUNDUZ 2005-05-08 09:54:51 Will new release require an initdb?
Previous Message Karsten Hilbert 2005-05-08 09:15:43 Re: [HACKERS] Invalid unicode in COPY problem