Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 9F4849FB2E8 for ; Sun, 4 Feb 2007 19:09:34 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 88837-03 for ; Sun, 4 Feb 2007 19:09:31 -0400 (AST) X-Greylist: delayed 00:24:39.924227 by SQLgrey-1.7.4 Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id CBF099FB2E2 for ; Sun, 4 Feb 2007 19:09:31 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from tiggs.net (206-223-169-74.beanfield.net [206.223.169.74]) by svr4.postgresql.org (Postfix) with ESMTP id 78A9E5AF938 for ; Sun, 4 Feb 2007 22:44:51 +0000 (GMT) Received: from localhost (206-223-169-82.beanfield.net [206.223.169.82]) by tiggs.net (Postfix) with ESMTP id E258527E43D; Sun, 4 Feb 2007 16:44:49 -0600 (CST) Received: from tiggs.net ([206.223.169.74]) by localhost (mx1.hub.org [206.223.169.82]) (amavisd-new, port 10024) with ESMTP id 43964-03; Sun, 4 Feb 2007 22:44:49 +0000 (UTC) Received: from [192.168.0.2] (cpe-74-67-174-32.rochester.res.rr.com [74.67.174.32]) by tiggs.net (Postfix) with ESMTP id 18D8E27E42F; Sun, 4 Feb 2007 16:44:48 -0600 (CST) Message-ID: <45C661E1.7080100@tiggs.net> Date: Sun, 04 Feb 2007 17:44:49 -0500 From: Charley Tiggs User-Agent: Thunderbird 1.5.0.9 (Macintosh/20061207) MIME-Version: 1.0 To: Karthikeyan Sundaram Cc: pgsql-php@postgresql.org Subject: Re: [SQL] Question regarding multibyte. References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.136 tagged_above=0 required=5 tests=BAYES_50, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200702/6 X-Sequence-Number: 3689 Karthikeyan Sundaram wrote: > Hi, > > I am new to postgres. I asked a question regarding multibyte > display. I got only one response. > Hence, I am re-iterating the question again to a larger audience. > > We are using 8.2 release of postgres. Recently we converted our > database to multibyte on our dev machine. we want to test the following. > > 1) How will I insert multibyte from our php? Do we need to use any > special encoding? > 2) I am using psql command line to get the data into a flat file and > push to our data warehouse > We use IBM redbrick warehouse. > 3) If I have multibyte, I know the output from the psql will scatter > to many lines. How can we avoid that. What is the sql command ? I need > 1 record per row to supply to our warehouse. > > Can somebody help me? > > Regards > skarthi http://www.php.net/mbstring http://www.php.net/iconv Those are the two pages that will give you more information about your needs. But these aren't the only factors when sending data collected via php to postgres. There's also your webserver and the user's browser to account for, both of which handle data according to the defaults of the browser. My solution to this problem was to standardize on UTF-8 and then use mbstring and iconv to convert everything to UTF-8. It's still not perfect as there are still characters that aren't converted properly. But by and large, it's extremely rare considering the amount of data we're dealing with. We also chose to use PHP to pull the data out of db and write to file. By doing this, we were able to make sure the data was encoded correctly. Charley