Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id CB2159FA5C8 for ; Mon, 27 Nov 2006 10:55:09 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 98680-04 for ; Mon, 27 Nov 2006 10:54:57 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from interscan.indicator.com (mail.indicator.be [193.121.199.3]) by postgresql.org (Postfix) with ESMTP id D58129FA2CA for ; Mon, 27 Nov 2006 10:55:02 -0400 (AST) Received: from DOMEXT-MTA by webaccess.indicator.bewith Novell_GroupWise; Mon, 27 Nov 2006 15:54:59 +0100 Message-Id: <456B0A47020000300000FC1E@webaccess.indicator.be> X-Mailer: Novell GroupWise Internet Agent 7.0.1 Date: Mon, 27 Nov 2006 15:54:47 +0100 From: "Bart Degryse" To: "Ragnar" Cc: Subject: Re: UNICODE and PL/PGSQL References: <456AD17A020000300000FB60@webaccess.indicator.be><1164638251.270 70.45.camel@localhost.localdomain> In-Reply-To: <1164638251.27070.45.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=__Part9CB8BE27.1__=" X-imss-version: 2.044 X-imss-result: Passed X-imss-approveListMatch: *@indicator.be X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/256 X-Sequence-Number: 26908 --=__Part9CB8BE27.1__= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit 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 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 --=__Part9CB8BE27.1__= Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Content-Description: HTML
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@hive.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


--=__Part9CB8BE27.1__=--