pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Fuhr <mike@fuhr.org>
To: Karthikeyan Sundaram <skarthi98@hotmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: questions on multibyte
Date: Thu, 1 Feb 2007 19:35:59 -0700
Message-ID: <20070202023559.GA90988@winnie.fuhr.org> (raw)
In-Reply-To: <BAY131-F18376C8B16F8585D25AEA2B0A40@phx.gbl>
References: <BAY131-F18376C8B16F8585D25AEA2B0A40@phx.gbl>

On Thu, Feb 01, 2007 at 07:01:31AM -0800, Karthikeyan Sundaram wrote:
> 1) How will I insert multibyte from insert statement?  I figured out a way 
> to insert multibyte, but want general opinion.

If you have UTF-8 data then treat it just like any other text string
and make sure client_encoding is set to 'UTF-8' or one of its aliases.
If the data is in some other encoding then set client_encoding 
appropriately and the database will automatically convert the data
to the server's encoding.

> 2) I want the data to be transferred to warehouse.

Do you mean a data warehouse?  What DBMS is the warehouse using?
What character encoding does it use?  UTF-8 or something else?

> 3) I login to psql and do a select the multibyte. (I did a plain select). 
> and push to a flat file so that the warehouse will upload. The data appread 
> to be scatterd to multiple lines which I am not able to insert into my 
> warehouse. How will display the multibyte chars from psql command line?

How did you "push to a flat file"?  Did you use COPY or psql's
\copy?  Does the data contain linefeeds and/or carriage returns?
Does the warehouse or your display understand UTF-8?  If not then
you might need to use client_encoding or a program like iconv or
uconv to convert the data to another encoding.

-- 
Michael Fuhr



view thread (4+ messages)  latest in thread

Message-ID: <20070202023559.GA90988@winnie.fuhr.org>
Permalink:  ../20070202023559.GA90988@winnie.fuhr.org/
Also on:    postgresql.org/message-id/20070202023559.GA90988@winnie.fuhr.org

 · 

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: mike@fuhr.org, skarthi98@hotmail.com
  Subject: Re: questions on multibyte
  In-Reply-To: <20070202023559.GA90988@winnie.fuhr.org>
  References: <BAY131-F18376C8B16F8585D25AEA2B0A40@phx.gbl> <20070202023559.GA90988@winnie.fuhr.org>

* 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