pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Charley Tiggs <lists@tiggs.net>
To: Karthikeyan Sundaram <skarthi98@hotmail.com>
Cc: pgsql-php@postgresql.org
Subject: Re: [SQL] Question regarding multibyte.
Date: Sun, 04 Feb 2007 17:44:49 -0500
Message-ID: <45C661E1.7080100@tiggs.net> (raw)
In-Reply-To: <BAY131-F8B75FE5FD2C5FD7127B30B0990@phx.gbl>
References: <BAY131-F8B75FE5FD2C5FD7127B30B0990@phx.gbl>

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



view thread (5+ messages)  latest in thread

Message-ID: <45C661E1.7080100@tiggs.net>
Permalink:  ../45C661E1.7080100@tiggs.net/
Also on:    postgresql.org/message-id/45C661E1.7080100@tiggs.net

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: lists@tiggs.net, skarthi98@hotmail.com, pgsql-php@postgresql.org
  Subject: Re: [SQL] Question regarding multibyte.
  In-Reply-To: <45C661E1.7080100@tiggs.net>

* 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