importing from a file with UTF-8 escape characters - Mailing list pgsql-general

From Seb
Subject importing from a file with UTF-8 escape characters
Date
Msg-id 873a1b80bt.fsf@kolob.sebmags.homelinux.org
Whole thread Raw
List pgsql-general
Hi,

I'm trying to import the geonames table from
http://download.geonames.org/export/dump/allCountries.zip.  A PostgreSQL
user recommended using:

create table geonames (
         geonameid       int,
         name            varchar(200),
         asciiname        varchar(200),
         alternatenames  varchar(4000),
         latitude        float,
         longitude       float,
         fclass  char(1),
         fcode   varchar(10),
         country varchar(2),
         cc2 varchar(60),
         admin1  varchar(20),
         admin2  varchar(80),
         admin3  varchar(20),
         admin4  varchar(20),
         population      bigint,
         elevation       int,
         gtopo30         int,
         timezone varchar(40),
         moddate         date
 );

but some lines in the file have strings of the form:

5881673    {1}útsaw Lake    {1}utsaw Lake        62.699499389    -136.737319993    H    LK    CA        12
 0        600    America/Dawson    2006-01-18 

which I take as UTF-8 escaped characters.  Any tips on how to import
this into the table so that they print properly?  Thanks.

Cheers,

--
Seb

pgsql-general by date:

Previous
From: Ben Chobot
Date:
Subject: Re: pg_stat_user_indexes and pg_stat_user_tables description?
Next
From: Ben Chobot
Date:
Subject: Re: questions about a table's row estimates