Re: UNICODE and PL/PGSQL

From: "Bart Degryse" <Bart(dot)Degryse(at)indicator(dot)be>
To: "Ragnar" <gnari(at)hive(dot)is>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: UNICODE and PL/PGSQL
Date: 2006-11-27 14:54:47
Message-ID: 456B0A47020000300000FC1E@webaccess.indicator.be
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi gnari,
I suppose your statement
test=# select '\x'||'65';
is done on some command line interface. I don't have that. I can only
use some client program. I'm using EMS SQL Manager 2007 and pgAdmin III
1.3
None of them accepts your statement.
My point is that in my first version of the function ( charset :=
charset || '\x65'; ) a unicode hex value for the letter e is stored in
charset.
When I try to do the same for a range of hex values ( FOR i IN
101..101 LOOP charset := charset || '\x' || to_hex(i); ) it is not
longer a bunch of hex values that get stored but a series of varchars.
When you run the first version of the function ( SELECT myfunction();
) 'e' is returned, with the second version 'x65' is returned, while I
want also 'e' to be returned.
Any ideas?

>>> Ragnar <gnari(at)hive(dot)is> 2006-11-27 15:37 >>>

On mán, 2006-11-27 at 11:52 +0100, Bart Degryse wrote:
> Dear all,
> This works: SELECT '\x65'; => it returns the letter 'e'.

yes, but:
test=# select '\x'||'65';
?column?
----------
x65
(1 row)

> When I do the following in PL/PGSQL ....

> FOR i IN 101..101 LOOP
> charset := charset || '\x' || to_hex(i);
> END LOOP;

gnari

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Markus Schaber 2006-11-27 15:16:35 Re: UNICODE and PL/PGSQL
Previous Message Ragnar 2006-11-27 14:37:31 Re: UNICODE and PL/PGSQL