pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ivo Rossacher <rossacher@bluewin.ch>
To: pgsql-admin@postgresql.org
Subject: Re: [SQL] Question regarding multibyte.
Date: Mon, 5 Feb 2007 00:26:42 +0100
Message-ID: <200702050026.42279.rossacher@bluewin.ch> (raw)
In-Reply-To: <BAY131-F8B75FE5FD2C5FD7127B30B0990@phx.gbl>
References: <BAY131-F8B75FE5FD2C5FD7127B30B0990@phx.gbl>

Am Sonntag, 4. Februar 2007 22.34 schrieb Karthikeyan Sundaram:
> Hi,
>
>    I am new to postgres.  I asked a question regarding multibyte display. 
> I got only one response.

Which was correct and about complet when taking the amount of information 
given into account. So nobody else did see a need for an other answer.

> 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?

You need to specify the client encoding of your php installation. (the last 
time I used it I think it was Latin1 for me) So after the connection is 
established send something like "set client_encoding='LATIN1'" to the server. 
From then on the server will automatically convert between the client and the 
server encoding for you.

>    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.

Here you need to find a way which makes your shell and the data warehouse 
happy. It depends on the data you have to transfer what will give the best 
solution. Here a very simple one which might create troubles in some special 
cases:
If you know the encoding your ware house is expecting just set the client 
encoding of the psql to what you ware house expects. Now the ware house 
should be able to read what from psql comes where mostpossible at the console 
you will not get the correct display anymore whit this setup.

>    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.

This is most probably only a problem of the editor/console related to wrong 
encoding settings and does not have anything to do with the real problem.
If this is not the case you have to escape the linebreakes in a way the 
warehouse understands (iconv, recode,...).

>
>     Can somebody help me?

I hope so.

Best regards
Ivo Rossacher
>
> Regards
> skarthi
>
> _________________________________________________________________
> Valentine’s Day -- Shop for gifts that spell L-O-V-E at MSN Shopping
> http://shopping.msn.com/content/shp/?ctId=8323,ptnrid=37,ptnrdata=24095&tco
>de=wlmtagline
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org



view thread (5+ messages)

Message-ID: <200702050026.42279.rossacher@bluewin.ch>
Permalink:  ../200702050026.42279.rossacher@bluewin.ch/
Also on:    postgresql.org/message-id/200702050026.42279.rossacher@bluewin.ch

 · 

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: rossacher@bluewin.ch, pgsql-admin@postgresql.org
  Subject: Re: [SQL] Question regarding multibyte.
  In-Reply-To: <200702050026.42279.rossacher@bluewin.ch>

* 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