Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 18E139FB2C9 for ; Thu, 1 Feb 2007 22:36:21 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-new, port 10024) with ESMTP id 51126-04 for ; Thu, 1 Feb 2007 22:36:01 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id 02BF69FB1DD for ; Thu, 1 Feb 2007 22:36:06 -0400 (AST) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.8/8.13.8) with ESMTP id l122a0uw098427 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 1 Feb 2007 19:36:03 -0700 (MST) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.8/8.13.8) with ESMTP id l122ZxI5091086; Thu, 1 Feb 2007 19:35:59 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.8/8.13.8/Submit) id l122ZxpQ091085; Thu, 1 Feb 2007 19:35:59 -0700 (MST) (envelope-from mfuhr) Date: Thu, 1 Feb 2007 19:35:59 -0700 From: Michael Fuhr To: Karthikeyan Sundaram Cc: pgsql-admin@postgresql.org Subject: Re: questions on multibyte Message-ID: <20070202023559.GA90988@winnie.fuhr.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/12 X-Sequence-Number: 24477 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