From Bart.Degryse@indicator.be Mon Nov 27 12:36:16 2006 Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id E375C9FA2F5 for ; Mon, 27 Nov 2006 08:36:16 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 51352-03 for ; Mon, 27 Nov 2006 08:36:05 -0400 (AST) X-Greylist: delayed 01:43:23.957813 by SQLgrey-1.7.4 Received: from interscan.indicator.com (mail.indicator.be [193.121.199.3]) by postgresql.org (Postfix) with ESMTP id 76D279FA2C7 for ; Mon, 27 Nov 2006 08:36:03 -0400 (AST) Received: from DOMEXT-MTA by webaccess.indicator.bewith Novell_GroupWise; Mon, 27 Nov 2006 11:52:37 +0100 Message-Id: <456AD17A020000300000FB60@webaccess.indicator.be> X-Mailer: Novell GroupWise Internet Agent 7.0.1 Date: Mon, 27 Nov 2006 11:52:26 +0100 From: "Bart Degryse" To: Subject: UNICODE and PL/PGSQL Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=__PartFEDADC7A.0__=" 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/253 X-Sequence-Number: 26905 --=__PartFEDADC7A.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Dear all, This works: SELECT '\x65'; =3D> it returns the letter 'e'. When I do the following in PL/PGSQL it returns the same letter 'e' (as = might be expected); =20 CREATE OR REPLACE FUNCTION "public"."myfunction" (out result varchar) = RETURNS varchar AS $body$ DECLARE charset varchar :=3D ''; BEGIN charset :=3D charset || '\x65'; result :=3D charset; RETURN; END; $body$ LANGUAGE 'plpgsql' IMMUTABLE RETURNS NULL ON NULL INPUT SECURITY INVOKER; =20 However, when I compose charset dynamically it doesn't work anymore. = Following function returns 'x65' instead of 'e'.=20 Can anyone tell me why that is and how to make it work? The target is of = course to change the values in the FOR control structure. =20 CREATE OR REPLACE FUNCTION "public"."myfunction" (out result varchar) = RETURNS varchar AS $body$ DECLARE charset varchar :=3D ''; BEGIN FOR i IN 101..101 LOOP charset :=3D charset || '\x' || to_hex(i); END LOOP; result :=3D charset; RETURN; END; $body$ LANGUAGE 'plpgsql' IMMUTABLE RETURNS NULL ON NULL INPUT SECURITY INVOKER; =20 Thanks for any help. Bart =20 --=__PartFEDADC7A.0__= Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Description: HTML
Dear all,
This works: SELECT '\x65'; =3D> it returns the letter 'e'.
When I do the following in PL/PGSQL it returns the same letter 'e' = (as might be expected);
 
CREATE OR REPLACE FUNCTION "public"."myfunction" (out result = varchar) RETURNS varchar AS
$body$
DECLARE
  charset varchar = :=3D '';
BEGIN
  charset :=3D charset || '\x65';
 &= nbsp;result :=3D charset;
  RETURN;
END;
$body$
LANGU= AGE 'plpgsql' IMMUTABLE RETURNS NULL ON NULL INPUT SECURITY INVOKER;
 
However, when I compose charset dynamically it doesn't work anymore. = Following function returns 'x65' instead of 'e'.
Can anyone tell me why that is and how to make it work? The = target is of course to change the values in the FOR control structure.
 
CREATE OR REPLACE FUNCTION "public"."myfunction" (out result = varchar) RETURNS varchar AS
$body$
DECLARE
  charset varchar = :=3D '';
BEGIN
  FOR i IN 101..101 LOOP
   = charset :=3D charset || '\x' || to_hex(i);
  END LOOP;
  result :=3D charset;
 = ; RETURN;
END;
$body$
LANGUAGE 'plpgsql' IMMUTABLE RETURNS NULL = ON NULL INPUT SECURITY INVOKER;
 
Thanks for any help.
Bart
 
--=__PartFEDADC7A.0__=-- From gnari@hive.is Mon Nov 27 14:31:08 2006 Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id A76D99FB215 for ; Mon, 27 Nov 2006 10:31:08 -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 95925-01 for ; Mon, 27 Nov 2006 10:30:49 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mx3.ipf.is (man.ipf.is [85.197.192.163]) by postgresql.org (Postfix) with ESMTP id E024A9FA2CA for ; Mon, 27 Nov 2006 10:30:53 -0400 (AST) Received: (qmail 2893 invoked by uid 1010); 27 Nov 2006 14:25:31 +0000 Received: from 88.149.106.19 by man (envelope-from , uid 1008) with qmail-scanner-1.25-st-qms (clamdscan: 0.88.4/1639. spamassassin: 3.1.4. perlscan: 1.25-st-qms. Clear:RC:1(88.149.106.19):SA:0(-2.5/4.5):. Processed in 2.982559 secs); 27 Nov 2006 14:25:31 -0000 X-Antivirus-HIVE-Mail-From: gnari@hive.is via man X-Antivirus-HIVE: 1.25-st-qms (Clear:RC:1(88.149.106.19):SA:0(-2.5/4.5):. Processed in 2.982559 secs Process 2886) Received: from dsl-149-106-19.hive.is (HELO ?192.168.1.33?) (88.149.106.19) by mx3.ipf.is with SMTP; 27 Nov 2006 14:25:28 +0000 Subject: Re: UNICODE and PL/PGSQL From: Ragnar To: Bart Degryse Cc: pgsql-sql@postgresql.org In-Reply-To: <456AD17A020000300000FB60@webaccess.indicator.be> References: <456AD17A020000300000FB60@webaccess.indicator.be> Content-Type: text/plain; charset=ISO-8859-1 Date: Mon, 27 Nov 2006 14:37:31 +0000 Message-Id: <1164638251.27070.45.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/255 X-Sequence-Number: 26907 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 From Bart.Degryse@indicator.be Mon Nov 27 14:55:09 2006 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__=-- From schabi@logix-tt.com Mon Nov 27 15:16:59 2006 Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 7ADE79FB1F8 for ; Mon, 27 Nov 2006 11:16:59 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 90657-05 for ; Mon, 27 Nov 2006 11:16:53 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) by postgresql.org (Postfix) with ESMTP id 81F189FB1CE for ; Mon, 27 Nov 2006 11:16:53 -0400 (AST) Received: from kingfisher.intern.logix-tt.com (84-72-188-217.dclient.hispeed.ch [84.72.188.217]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logix-tt.com (Postfix) with ESMTP id CA8766403E; Mon, 27 Nov 2006 16:19:41 +0100 (CET) Received: from [127.0.0.1] (localhost [127.0.0.1]) by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id 1F89A18148C92; Mon, 27 Nov 2006 16:16:36 +0100 (CET) Message-ID: <456B0153.3010603@logix-tt.com> Date: Mon, 27 Nov 2006 16:16:35 +0100 From: Markus Schaber Reply-To: pgsql-sql@postgresql.org Organization: Logical Tracking and Tracing International AG, Switzerland User-Agent: Thunderbird 1.5.0.7 (X11/20060927) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Cc: Bart Degryse Subject: Re: UNICODE and PL/PGSQL References: <456AD17A020000300000FB60@webaccess.indicator.be><1164638251.270 70.45.camel@localhost.localdomain> <456B0A47020000300000FC1E@webaccess.indicator.be> In-Reply-To: <456B0A47020000300000FC1E@webaccess.indicator.be> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/257 X-Sequence-Number: 26909 Hi, Bart, Bart Degryse wrote: > 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. All versions of PostgreSQL I know are shipped with "psql" as command line interface. (It's a client program, actually. :-) > I'm using EMS SQL Manager 2007 and pgAdmin III 1.3 > None of them accepts your statement. I just tried with pgAdmin III 1.4.3, and it worked fine. > 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. The problem is that the \x escaping is done in the parser, so in your first function, the query engine actually sees "charset := charset || 'e';" In the second function, the '\x' string is parsed as is, and converted to the String 'x' instead of being rejected as broken \x sequence, I think for compatibility reasons. Then, the engine sees: "charset := charset || 'x' || to_hex(i);" Maybe you can change it to (ASCII version): "charset := charset || chr(i);" or (256-bit version): "charset := charset || decode(to_hex(i),'hex'); HTH, Markus -- Markus Schaber | Logical Tracking&Tracing International AG Dipl. Inf. | Software Development GIS Fight against software patents in Europe! www.ffii.org www.nosoftwarepatents.org From Bart.Degryse@indicator.be Mon Nov 27 15:33:29 2006 Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 920F79FB1F8 for ; Mon, 27 Nov 2006 11:33:29 -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 06396-01 for ; Mon, 27 Nov 2006 11:32:55 -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 1EB8E9FB1CE for ; Mon, 27 Nov 2006 11:33:00 -0400 (AST) Received: from DOMEXT-MTA by webaccess.indicator.bewith Novell_GroupWise; Mon, 27 Nov 2006 16:32:58 +0100 Message-Id: <456B132F020000300000FC4B@webaccess.indicator.be> X-Mailer: Novell GroupWise Internet Agent 7.0.1 Date: Mon, 27 Nov 2006 16:32:47 +0100 From: "Bart Degryse" To: , Subject: Re: UNICODE and PL/PGSQL References: <456AD17A020000300000FB60@webaccess.indicator.be><1164638251.270 70.45.camel@localhost.localdomain><456B0A47020000300000FC1E@webaccess.indi cator.be><456B0A47020000300000FC1E@webaccess.indicator.be><456B0153.3010603 @logix-tt.com> In-Reply-To: <456B0153.3010603@logix-tt.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=__Part4C686F0F.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/259 X-Sequence-Number: 26911 --=__Part4C686F0F.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi Markus, I should have said "The ICT department doesn't give me access to the psql = command line interface". Thanks for explaining what goes wrong. I now understand the problem. It = doesn't solve it though. I haven't tried your first suggestion since ASCII won't be good enough. I = also need to be able to do something like charset :=3D charset || '\xC2\xA9'; but then in the dynamic form like charset :=3D charset || '\xC2\x' || to_hex(i)'; So I thought your second suggestion might be of help. I get an error though: ERROR: operator does not exist: character varying || bytea HINT: No operator matches the given name and argument type(s). You may = need to add explicit type casts. CONTEXT: SQL statement "SELECT $1 || decode(to_hex( $2 ), 'hex')" >>> Markus Schaber 2006-11-27 16:16 >>> Hi, Bart, Bart Degryse wrote: > I suppose your statement > test=3D# select '\x'||'65'; > is done on some command line interface. I don't have that. I can only > use some client program. All versions of PostgreSQL I know are shipped with "psql" as command line interface. (It's a client program, actually. :-) > I'm using EMS SQL Manager 2007 and pgAdmin III 1.3 > None of them accepts your statement. I just tried with pgAdmin III 1.4.3, and it worked fine. > When I try to do the same for a range of hex values ( FOR i IN 101..101 > LOOP charset :=3D charset || '\x' || to_hex(i); ) it is not longer a > bunch of hex values that get stored but a series of varchars. The problem is that the \x escaping is done in the parser, so in your first function, the query engine actually sees "charset :=3D charset || 'e';" In the second function, the '\x' string is parsed as is, and converted to the String 'x' instead of being rejected as broken \x sequence, I think for compatibility reasons. Then, the engine sees: "charset :=3D charset || 'x' || to_hex(i);" Maybe you can change it to (ASCII version): "charset :=3D charset || chr(i);" or (256-bit version): "charset :=3D charset || decode(to_hex(i),'hex'); HTH, Markus --=20 Markus Schaber | Logical Tracking&Tracing International AG Dipl. Inf. | Software Development GIS Fight against software patents in Europe! www.ffii.org www.nosoftwarepatents.org --=__Part4C686F0F.1__= Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Description: HTML
Hi Markus,
I should have said "The ICT department doesn't give me access to the = psql command line interface".
Thanks for explaining what goes wrong. I now understand the problem. = It doesn't solve it though.
I haven't tried your first suggestion since ASCII won't be = good enough. I also need to be able to do something like
  charset :=3D charset || '\xC2\xA9';
but then in the dynamic form like
  charset :=3D charset || '\xC2\x' || to_hex(i)';
So I = thought your second suggestion might be of help.
I get an error though:
ERROR:  operator does not exist: character varying || bytea
HI= NT:  No operator matches the given name and argument type(s). You may = need to add explicit type casts.
CONTEXT:  SQL statement "SELECT&nb= sp;  $1  || decode(to_hex( $2 ), 'hex')"

>>> Markus Schaber <schabi@logix-tt.com> 2006-11-27= 16:16 >>>
Hi, Bart,

Bart Degryse wrote:

&= gt; I suppose your statement
> test=3D# select '\x'||'65';
> = is done on some command line interface. I don't have that. I can only
&g= t; use some client program.

All versions of PostgreSQL I know are = shipped with "psql" as command
line interface. (It's a client program, = actually. :-)

> I'm using EMS SQL Manager 2007 and pgAdmin III = 1.3
> None of them accepts your statement.

I just tried with = pgAdmin III 1.4.3, and it worked fine.

> When I try to do the = same for a range of hex values (  FOR i IN 101..101
> LOOP =    charset :=3D charset || '\x' || to_hex(i);  ) it is not = longer a
> bunch of hex values that get stored but a series of = varchars.

The problem is that the \x escaping is done in the = parser, so in your
first function, the query engine actually sees
"ch= arset :=3D charset || 'e';"

In the second function, the '\x' string = is parsed as is, and converted
to the String 'x' instead of being = rejected as broken \x sequence, I
think for compatibility reasons. = Then, the engine sees:
"charset :=3D charset || 'x' || to_hex(i);"

Maybe you can change it to (ASCII version):
"charset :=3D charset = || chr(i);"
or (256-bit version):
"charset :=3D charset || decode(to_= hex(i),'hex');


HTH,
Markus
--
Markus Schaber | = Logical Tracking&Tracing International AG
Dipl. Inf.  &nbs= p;  | Software Development GIS

Fight against software patents = in Europe! www.ffii.org
www.nosoftwarepatents.org
=
--=__Part4C686F0F.1__=-- From schabi@logix-tt.com Mon Nov 27 15:53:36 2006 Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id CB5F39FA252 for ; Mon, 27 Nov 2006 11:53:36 -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 09455-05 for ; Mon, 27 Nov 2006 11:53:12 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) by postgresql.org (Postfix) with ESMTP id 205C49FA23F for ; Mon, 27 Nov 2006 11:53:19 -0400 (AST) Received: from kingfisher.intern.logix-tt.com (84-72-188-217.dclient.hispeed.ch [84.72.188.217]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logix-tt.com (Postfix) with ESMTP id 1F1A46403E; Mon, 27 Nov 2006 16:56:07 +0100 (CET) Received: from [127.0.0.1] (localhost [127.0.0.1]) by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id 5138818148C92; Mon, 27 Nov 2006 16:53:01 +0100 (CET) Message-ID: <456B09DD.909@logix-tt.com> Date: Mon, 27 Nov 2006 16:53:01 +0100 From: Markus Schaber Reply-To: pgsql-sql@postgresql.org Organization: Logical Tracking and Tracing International AG, Switzerland User-Agent: Thunderbird 1.5.0.7 (X11/20060927) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Cc: Bart Degryse Subject: Re: UNICODE and PL/PGSQL References: <456AD17A020000300000FB60@webaccess.indicator.be><1164638251.270 70.45.camel@localhost.localdomain><456B0A47020000300000FC1E@webaccess.indi cator.be><456B0A47020000300000FC1E@webaccess.indicator.be><456B0153.3010603 @logix-tt.com> <456B132F020000300000FC4B@webaccess.indicator.be> In-Reply-To: <456B132F020000300000FC4B@webaccess.indicator.be> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/262 X-Sequence-Number: 26914 Hi, Bart, Bart Degryse wrote: > I should have said "The ICT department doesn't give me access to the > psql command line interface". Hmm, and you can't install psql on the same host you use to run pgadmin? It's just a client, that connects to PostgreSQL the same way as pgamdin. > ERROR: operator does not exist: character varying || bytea > HINT: No operator matches the given name and argument type(s). You may > need to add explicit type casts. > CONTEXT: SQL statement "SELECT $1 || decode(to_hex( $2 ), 'hex')" Hmm. Strange. Does it happen in a plpgsql function, or when issuing the select as PREPARE statement via pgadmin? Which PostgreSQL version are you running? Markus -- Markus Schaber | Logical Tracking&Tracing International AG Dipl. Inf. | Software Development GIS Fight against software patents in Europe! www.ffii.org www.nosoftwarepatents.org From dev@archonet.com Mon Nov 27 15:51:52 2006 Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id C83A89FB1F8 for ; Mon, 27 Nov 2006 11:51:52 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 98702-04 for ; Mon, 27 Nov 2006 11:51:41 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by postgresql.org (Postfix) with ESMTP id 087E39FA23F for ; Mon, 27 Nov 2006 11:51:41 -0400 (AST) Received: from mainbox.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id 503E374721; Mon, 27 Nov 2006 15:50:22 +0000 (GMT) Received: from [192.168.1.17] (client17.office.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 5A43015EAB; Mon, 27 Nov 2006 15:50:21 +0000 (GMT) Message-ID: <456B0A0A.2080009@archonet.com> Date: Mon, 27 Nov 2006 15:53:46 +0000 From: Richard Huxton User-Agent: Thunderbird 1.5.0.8 (X11/20061115) MIME-Version: 1.0 To: Bart Degryse Cc: ", pgsql-sql@postgresql.org Subject: Re: UNICODE and PL/PGSQL References: <456AD17A020000300000FB60@webaccess.indicator.be><1164638251.270 70.45.camel@localhost.localdomain><456B0A47020000300000FC1E@webaccess.indi cator.be><456B0A47020000300000FC1E@webaccess.indicator.be><456B0153.3010603 @logix-tt.com> <456B132F020000300000FC4B@webaccess.indicator.be> In-Reply-To: <456B132F020000300000FC4B@webaccess.indicator.be> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/261 X-Sequence-Number: 26913 Bart Degryse wrote: > Hi Markus, > I should have said "The ICT department doesn't give me access to the psql command line interface". > Thanks for explaining what goes wrong. I now understand the problem. It doesn't solve it though. What's wrong with the chr() function? http://www.postgresql.org/docs/8.1/static/functions-string.html -- Richard Huxton Archonet Ltd From gnari@hive.is Mon Nov 27 15:50:45 2006 Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 683489FA252 for ; Mon, 27 Nov 2006 11:50:45 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 98702-03 for ; Mon, 27 Nov 2006 11:50:33 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mx3.ipf.is (man.ipf.is [85.197.192.163]) by postgresql.org (Postfix) with ESMTP id 3FE3A9FB1CE for ; Mon, 27 Nov 2006 11:50:33 -0400 (AST) Received: (qmail 12942 invoked by uid 1010); 27 Nov 2006 15:45:12 +0000 Received: from 88.149.106.19 by man (envelope-from , uid 1008) with qmail-scanner-1.25-st-qms (clamdscan: 0.88.4/1639. spamassassin: 3.1.4. perlscan: 1.25-st-qms. Clear:RC:1(88.149.106.19):SA:0(-2.5/4.5):. Processed in 4.200082 secs); 27 Nov 2006 15:45:12 -0000 X-Antivirus-HIVE-Mail-From: gnari@hive.is via man X-Antivirus-HIVE: 1.25-st-qms (Clear:RC:1(88.149.106.19):SA:0(-2.5/4.5):. Processed in 4.200082 secs Process 12923) Received: from dsl-149-106-19.hive.is (HELO ?192.168.1.33?) (88.149.106.19) by mx3.ipf.is with SMTP; 27 Nov 2006 15:45:07 +0000 Subject: Re: UNICODE and PL/PGSQL From: Ragnar To: Bart Degryse Cc: pgsql-sql@postgresql.org In-Reply-To: <456B0A47020000300000FC1E@webaccess.indicator.be> References: <456AD17A020000300000FB60@webaccess.indicator.be> <1164638251.270 70.45.camel@localhost.localdomain> <456B0A47020000300000FC1E@webaccess.indicator.be> Content-Type: text/plain; charset=ISO-8859-1 Date: Mon, 27 Nov 2006 15:57:10 +0000 Message-Id: <1164643030.27070.55.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/260 X-Sequence-Number: 26912 On mán, 2006-11-27 at 15:54 +0100, Bart Degryse wrote: > 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. my point was that '\x65' as a literal is read as 'e', but '\\x' || '65' is just the concatation of 2 2-char varchars > 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); ) you might be able to do what you want with set_byte() and encode(). CREATE OR REPLACE FUNCTION myfunction() RETURNS varchar AS $x$ DECLARE x bytea := ' '; BEGIN FOR i in 101..105 LOOP x:=set_byte(x,i-101,i); END LOOP; RETURN encode(x,''escape''); END; $x$ LANGUAGE 'plpgsql'; select myfunction(); gnari From Bart.Degryse@indicator.be Mon Nov 27 16:05:36 2006 Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id EEB999FA23F for ; Mon, 27 Nov 2006 12:05:36 -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 11710-06 for ; Mon, 27 Nov 2006 12:05:28 -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 202B79FA252 for ; Mon, 27 Nov 2006 12:05:27 -0400 (AST) Received: from DOMEXT-MTA by webaccess.indicator.bewith Novell_GroupWise; Mon, 27 Nov 2006 17:05:25 +0100 Message-Id: <456B1ACF020000300000FC74@webaccess.indicator.be> X-Mailer: Novell GroupWise Internet Agent 7.0.1 Date: Mon, 27 Nov 2006 17:05:19 +0100 From: "Bart Degryse" To: "Richard Huxton" Cc: ", Subject: Re: UNICODE and PL/PGSQL References: <456AD17A020000300000FB60@webaccess.indicator.be><1164638251.270 70.45.camel@localhost.localdomain><456B0A47020000300000FC1E@webaccess.ind i cator.be><456B0A47020000300000FC1E@webaccess.indicator.be><456B0153.30106 03 @logix-tt.com><456B132F020000300000FC4B@webaccess.indicator.be><456B132F 020000300000FC4B@webaccess.indicator.be><456B0A0A.2080009@archonet.com> In-Reply-To: <456B0A0A.2080009@archonet.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=__PartE5C1C6AF.2__=" 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/264 X-Sequence-Number: 26916 --=__PartE5C1C6AF.2__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable As the manual says : Character with the given ASCII code I need characters outside the ASCII range. Something like charset :=3D charset || '\xC2\x' || to_hex(i)'; >>> Richard Huxton 2006-11-27 16:53 >>> Bart Degryse wrote: > Hi Markus, > I should have said "The ICT department doesn't give me access to the = psql command line interface". > Thanks for explaining what goes wrong. I now understand the problem. It = doesn't solve it though. What's wrong with the chr() function? http://www.postgresql.org/docs/8.1/static/functions-string.html --=20 Richard Huxton Archonet Ltd --=__PartE5C1C6AF.2__= Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Description: HTML
As the manual says : Character with the given ASCII code
I need characters outside the ASCII range. Something like
  charset :=3D charset || '\xC2\x' || to_hex(i)';

>>= > Richard Huxton <dev@archonet.com> 2006-11-27 16:53 >>><= BR>
Bart Degryse wrote:
> Hi Markus,
>= ; I should have said "The ICT department doesn't give me access to the = psql command line interface".
> Thanks for explaining what goes = wrong. I now understand the problem. It doesn't solve it though.

Wha= t's wrong with the chr() function?
http://www.postgresql.org/docs/8.1/s= tatic/functions-string.html

--
   Richard = Huxton
   Archonet Ltd
--=__PartE5C1C6AF.2__=-- From Bart.Degryse@indicator.be Mon Nov 27 16:10:50 2006 Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id AC6349FA23F for ; Mon, 27 Nov 2006 12:10:50 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 04737-01 for ; Mon, 27 Nov 2006 12:10:43 -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 6EAD89FA231 for ; Mon, 27 Nov 2006 12:10:42 -0400 (AST) Received: from DOMEXT-MTA by webaccess.indicator.bewith Novell_GroupWise; Mon, 27 Nov 2006 17:10:40 +0100 Message-Id: <456B1C07020000300000FC7F@webaccess.indicator.be> X-Mailer: Novell GroupWise Internet Agent 7.0.1 Date: Mon, 27 Nov 2006 17:10:31 +0100 From: "Bart Degryse" To: , Cc: "Richard Huxton" Subject: Re: UNICODE and PL/PGSQL References: <456AD17A020000300000FB60@webaccess.indicator.be><1164638251.270 70.45.camel@localhost.localdomain><456B0A47020000300000FC1E@webaccess.ind i cator.be><456B0A47020000300000FC1E@webaccess.indicator.be><456B0153.30106 03 @logix-tt.com><456B132F020000300000FC4B@webaccess.indicator.be><456B132F 020000300000FC4B@webaccess.indicator.be><456B09DD.909@logix-tt.com> In-Reply-To: <456B09DD.909@logix-tt.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=__PartAC888FE7.2__=" 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/265 X-Sequence-Number: 26917 --=__PartAC888FE7.2__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable I haven't got enough permissions to install new programs. Big brother... = ;-) I get the error in a plpgsql function I use PostgreSQL 8.1.4 with EMS SQL Manager 2005 (3.6.0.1). >>> Markus Schaber 2006-11-27 16:53 >>> Hi, Bart, Bart Degryse wrote: > I should have said "The ICT department doesn't give me access to the > psql command line interface". Hmm, and you can't install psql on the same host you use to run pgadmin? It's just a client, that connects to PostgreSQL the same way as pgamdin. > ERROR: operator does not exist: character varying || bytea > HINT: No operator matches the given name and argument type(s). You may > need to add explicit type casts. > CONTEXT: SQL statement "SELECT $1 || decode(to_hex( $2 ), 'hex')" Hmm. Strange. Does it happen in a plpgsql function, or when issuing the select as PREPARE statement via pgadmin? Which PostgreSQL version are you running? Markus --=20 Markus Schaber | Logical Tracking&Tracing International AG Dipl. Inf. | Software Development GIS Fight against software patents in Europe! www.ffii.org www.nosoftwarepatents.org --=__PartAC888FE7.2__= Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Description: HTML
I haven't got enough permissions to install new programs. Big = brother... ;-)
I get the error in a plpgsql function
I use PostgreSQL 8.1.4 with EMS SQL Manager 2005 (3.6.0.1).

>= ;>> Markus Schaber <schabi@logix-tt.com> 2006-11-27 16:53 = >>>
Hi, Bart,

Bart Degryse wrote:

&= gt; I should have said "The ICT department doesn't give me access to = the
> psql command line interface".

Hmm, and you can't = install psql on the same host you use to run pgadmin?

It's just a = client, that connects to PostgreSQL the same way as pgamdin.


>= ; ERROR:  operator does not exist: character varying || bytea
> = HINT:  No operator matches the given name and argument type(s). You = may
> need to add explicit type casts.
> CONTEXT:  SQL = statement "SELECT   $1  || decode(to_hex( $2 ), 'hex')"
<= BR>Hmm. Strange.

Does it happen in a plpgsql function, or when = issuing the select as
PREPARE statement via pgadmin?

Which = PostgreSQL version are you running?

Markus

--
Markus = Schaber | Logical Tracking&Tracing International AG
Dipl. Inf. =     | Software Development GIS

Fight against = software patents in Europe! www.ffii.org
www.nosoftwarepatents.org=
--=__PartAC888FE7.2__=-- From schabi@logix-tt.com Mon Nov 27 16:34:43 2006 Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 99BF29FA2F5 for ; Mon, 27 Nov 2006 12:34:43 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 09152-05 for ; Mon, 27 Nov 2006 12:34:34 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail.logix-tt.com (mail.logix-tt.com [212.211.145.186]) by postgresql.org (Postfix) with ESMTP id 0EA699FA2E0 for ; Mon, 27 Nov 2006 12:34:34 -0400 (AST) Received: from kingfisher.intern.logix-tt.com (84-72-188-217.dclient.hispeed.ch [84.72.188.217]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logix-tt.com (Postfix) with ESMTP id 1B14E6403E; Mon, 27 Nov 2006 17:37:23 +0100 (CET) Received: from [127.0.0.1] (localhost [127.0.0.1]) by kingfisher.intern.logix-tt.com (Postfix) with ESMTP id 1B7FA18148C92; Mon, 27 Nov 2006 17:34:17 +0100 (CET) Message-ID: <456B1388.10707@logix-tt.com> Date: Mon, 27 Nov 2006 17:34:16 +0100 From: Markus Schaber Reply-To: Bart Degryse Organization: Logical Tracking and Tracing International AG, Switzerland User-Agent: Thunderbird 1.5.0.7 (X11/20060927) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Cc: Bart Degryse Subject: Re: UNICODE and PL/PGSQL References: <456AD17A020000300000FB60@webaccess.indicator.be><1164638251.270 70.45.camel@localhost.localdomain><456B0A47020000300000FC1E@webaccess.ind i cator.be><456B0A47020000300000FC1E@webaccess.indicator.be><456B0153.30106 03 @logix-tt.com><456B132F020000300000FC4B@webaccess.indicator.be><456B132F 020000300000FC4B@webaccess.indicator.be><456B09DD.909@logix-tt.com> <456B1C07020000300000FC7F@webaccess.indicator.be> In-Reply-To: <456B1C07020000300000FC7F@webaccess.indicator.be> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/267 X-Sequence-Number: 26919 Hi, Bart, Bart Degryse wrote: > I haven't got enough permissions to install new programs. Big brother... ;-) A developer doesn't get the permissions to use the tools he need for his work? Developers absolutely _must_ have root / admin permissions on their own workstations, that's a prerequirement for them to fulfil their job. Time to search a new employer, honest! > I get the error in a plpgsql function Ah, I just saw that the "decode" function returns bytea, not text. I'll need a further look into this... Sorry, Markus -- Markus Schaber | Logical Tracking&Tracing International AG Dipl. Inf. | Software Development GIS Fight against software patents in Europe! www.ffii.org www.nosoftwarepatents.org From dev@archonet.com Mon Nov 27 16:31:43 2006 Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id B149B9FA252 for ; Mon, 27 Nov 2006 12:31:43 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 07390-07 for ; Mon, 27 Nov 2006 12:31:30 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by postgresql.org (Postfix) with ESMTP id F27999FA231 for ; Mon, 27 Nov 2006 12:31:29 -0400 (AST) Received: from mainbox.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id 2C23E14C8DD; Mon, 27 Nov 2006 16:31:29 +0000 (GMT) Received: from [192.168.1.17] (client17.office.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 89ABA15EAB; Mon, 27 Nov 2006 16:31:28 +0000 (GMT) Message-ID: <456B13AE.1090100@archonet.com> Date: Mon, 27 Nov 2006 16:34:54 +0000 From: Richard Huxton User-Agent: Thunderbird 1.5.0.8 (X11/20061115) MIME-Version: 1.0 To: Bart Degryse Cc: ", pgsql-sql@postgresql.org Subject: Re: UNICODE and PL/PGSQL References: <456AD17A020000300000FB60@webaccess.indicator.be><1164638251.270 70.45.camel@localhost.localdomain><456B0A47020000300000FC1E@webaccess.ind i cator.be><456B0A47020000300000FC1E@webaccess.indicator.be><456B0153.30106 03 @logix-tt.com><456B132F020000300000FC4B@webaccess.indicator.be><456B132F 020000300000FC4B@webaccess.indicator.be><456B0A0A.2080009@archonet.com> <456B1ACF020000300000FC74@webaccess.indicator.be> In-Reply-To: <456B1ACF020000300000FC74@webaccess.indicator.be> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/266 X-Sequence-Number: 26918 Bart Degryse wrote: > As the manual says : Character with the given ASCII code > I need characters outside the ASCII range. Something like > charset := charset || '\xC2\x' || to_hex(i)'; Well, if you've tried it for characters > 127 and it didn't work then I don't know that it is possible at all. You *did* try the function? -- Richard Huxton Archonet Ltd From Bart.Degryse@indicator.be Tue Nov 28 08:14:39 2006 Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id A59FD9FA430 for ; Tue, 28 Nov 2006 04:14:39 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 10960-06 for ; Tue, 28 Nov 2006 04:14:31 -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 44C619FB1C4 for ; Tue, 28 Nov 2006 04:14:33 -0400 (AST) Received: from DOMEXT-MTA by webaccess.indicator.bewith Novell_GroupWise; Tue, 28 Nov 2006 09:14:30 +0100 Message-Id: <456BFDEE.A3DD.0030.0@indicator.be> X-Mailer: Novell GroupWise Internet Agent 7.0.1 Date: Tue, 28 Nov 2006 09:14:23 +0100 From: "Bart Degryse" To: "Richard Huxton" Cc: ", Subject: Re: UNICODE and PL/PGSQL References: <456AD17A020000300000FB60@webaccess.indicator.be><1164638251.270 70.45.camel@localhost.localdomain><456B0A47020000300000FC1E@webaccess.in d i cator.be><456B0A47020000300000FC1E@webaccess.indicator.be><456B0153.301 06 03 @logix-tt.com><456B132F020000300000FC4B@webaccess.indicator.be><456B1 32F 020000300000FC4B@webaccess.indicator.be><456B0A0A.2080009@archonet.com> <456B1ACF020000300000FC74@webaccess.indicator.be><456B1ACF020000300000FC74@ webaccess.indicator.be><456B13AE.1090100@archonet.com> In-Reply-To: <456B13AE.1090100@archonet.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=__Part664245CF.2__=" 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/270 X-Sequence-Number: 26922 --=__Part664245CF.2__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Yes, I tried and it didn't work. PostgreSQL surely makes something of it, = but not the right characters. Unless Markus can make his idea using "decode" work, this might be = something pl/pgsql cannot do. >>> Richard Huxton 2006-11-27 17:34 >>> Bart Degryse wrote: > As the manual says : Character with the given ASCII code > I need characters outside the ASCII range. Something like > charset :=3D charset || '\xC2\x' || to_hex(i)'; Well, if you've tried it for characters > 127 and it didn't work then I=20 don't know that it is possible at all. You *did* try the function? --=20 Richard Huxton Archonet Ltd --=__Part664245CF.2__= Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Description: HTML
Yes, I tried and it didn't work. PostgreSQL surely makes something of = it, but not the right characters.
Unless Markus can make his idea using "decode" work, this might be = something pl/pgsql cannot do.

>>> Richard Huxton <dev@ar= chonet.com> 2006-11-27 17:34 >>>
Bart Degryse wrote:
>= As the manual says : Character with the given ASCII code
> I need = characters outside the ASCII range. Something like
>   = charset :=3D charset || '\xC2\x' || to_hex(i)';

Well, if you've = tried it for characters > 127 and it didn't work then I
don't know = that it is possible at all. You *did* try the function?

-- =
   Richard Huxton
   Archonet Ltd
--=__Part664245CF.2__=-- From Bart.Degryse@indicator.be Tue Nov 28 08:16:36 2006 Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id ACFA09FB1E7 for ; Tue, 28 Nov 2006 04:16:36 -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 56503-09 for ; Tue, 28 Nov 2006 04:16:30 -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 C29F29FA430 for ; Tue, 28 Nov 2006 04:16:30 -0400 (AST) Received: from DOMEXT-MTA by webaccess.indicator.bewith Novell_GroupWise; Tue, 28 Nov 2006 09:16:27 +0100 Message-Id: <456BFE5E.A3DD.0030.0@indicator.be> X-Mailer: Novell GroupWise Internet Agent 7.0.1 Date: Tue, 28 Nov 2006 09:16:15 +0100 From: "Bart Degryse" To: "Markus Schaber" , Subject: Re: UNICODE and PL/PGSQL References: <456AD17A020000300000FB60@webaccess.indicator.be><1164638251.270 70.45.camel@localhost.localdomain><456B0A47020000300000FC1E@webaccess.in d i cator.be><456B0A47020000300000FC1E@webaccess.indicator.be><456B0153.301 06 03 @logix-tt.com><456B132F020000300000FC4B@webaccess.indicator.be><456B1 32F 020000300000FC4B@webaccess.indicator.be><456B09DD.909@logix-tt.com><456 B1C07020000300000FC7F@webaccess.indicator.be><456B1C07020000300000FC7F@weba ccess.indicator.be><456B1388.10707@logix-tt.com> In-Reply-To: <456B1388.10707@logix-tt.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=__PartE9CDCA5F.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/271 X-Sequence-Number: 26923 --=__PartE9CDCA5F.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Basically, I agree with your viewpoint on developer's permissions, but any = annoyance can be fixed with a large enough paycheck... >>> Markus Schaber 2006-11-27 17:34 >>> Hi, Bart, Bart Degryse wrote: > I haven't got enough permissions to install new programs. Big brother... = ;-) A developer doesn't get the permissions to use the tools he need for his work? Developers absolutely _must_ have root / admin permissions on their own workstations, that's a prerequirement for them to fulfil their job. Time to search a new employer, honest! > I get the error in a plpgsql function Ah, I just saw that the "decode" function returns bytea, not text. I'll need a further look into this... Sorry, Markus --=20 Markus Schaber | Logical Tracking&Tracing International AG Dipl. Inf. | Software Development GIS Fight against software patents in Europe! www.ffii.org=20 www.nosoftwarepatents.org --=__PartE9CDCA5F.1__= Content-Type: text/html; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Description: HTML
Basically, I agree with your viewpoint on developer's permissions, = but any annoyance can be fixed with a large enough paycheck...


>>> Markus Schaber <schabi@logix-tt.com> = 2006-11-27 17:34 >>>
Hi, Bart,

Bart Degryse wrote:
&g= t; I haven't got enough permissions to install new programs. Big brother...= ;-)

A developer doesn't get the permissions to use the tools he = need for his
work?

Developers absolutely _must_ have root / = admin permissions on their own
workstations, that's a prerequirement = for them to fulfil their job.

Time to search a new employer, = honest!

> I get the error in a plpgsql function

Ah, I = just saw that the "decode" function returns bytea, not text.

I'll = need a further look into this...

Sorry,
Markus

-- =
Markus Schaber | Logical Tracking&Tracing International AG
Dipl.= Inf.     | Software Development GIS

Fight = against software patents in Europe! www.ffii.org
www.nosoftwarepatents.o= rg
--=__PartE9CDCA5F.1__=-- From gnari@hive.is Tue Nov 28 09:21:48 2006 Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 4BCBA9FB1E7 for ; Tue, 28 Nov 2006 05:21:48 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 48529-06 for ; Tue, 28 Nov 2006 05:21:29 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mx1.ipf.is (mack.ipf.is [85.197.192.164]) by postgresql.org (Postfix) with ESMTP id 46C719FA430 for ; Tue, 28 Nov 2006 05:21:29 -0400 (AST) Received: (qmail 26665 invoked by uid 1010); 28 Nov 2006 09:18:41 +0000 Received: from 88.149.106.19 by mack (envelope-from , uid 1008) with qmail-scanner-1.25-st-qms (clamdscan: 0.88.4/1639. spamassassin: 3.1.4. perlscan: 1.25-st-qms. Clear:RC:1(88.149.106.19):SA:0(-2.3/4.5):. Processed in 0.307528 secs); 28 Nov 2006 09:18:41 -0000 X-Antivirus-HIVE-Mail-From: gnari@hive.is via mack X-Antivirus-HIVE: 1.25-st-qms (Clear:RC:1(88.149.106.19):SA:0(-2.3/4.5):. Processed in 0.307528 secs Process 26657) Received: from dsl-149-106-19.hive.is (HELO ?192.168.1.33?) (88.149.106.19) by mx1.ipf.is with SMTP; 28 Nov 2006 09:18:40 +0000 Subject: Re: UNICODE and PL/PGSQL From: Ragnar To: Bart Degryse Cc: pgsql-sql@postgresql.org In-Reply-To: <456BFDEE.A3DD.0030.0@indicator.be> References: <456AD17A020000300000FB60@webaccess.indicator.be> <1164638251.270 70.45.camel@localhost.localdomain> <456B0A47020000300000FC1E@webaccess.in d i cator.be> <456B0A47020000300000FC1E@webaccess.indicator.be> <456B0153.301 06 03 @logix-tt.com> <456B132F020000300000FC4B@webaccess.indicator.be> <456B1 32F 020000300000FC4B@webaccess.indicator.be> <456B0A0A.2080009@archonet.com> <456B1ACF020000300000FC74@webaccess.indicator.be> <456B1ACF020000300000FC74@ webaccess.indicator.be> <456B13AE.1090100@archonet.com> <456BFDEE.A3DD.0030.0@indicator.be> Content-Type: text/plain; charset=ISO-8859-1 Date: Tue, 28 Nov 2006 09:28:18 +0000 Message-Id: <1164706098.27070.135.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/272 X-Sequence-Number: 26924 On ₫ri, 2006-11-28 at 09:14 +0100, Bart Degryse wrote: > Yes, I tried and it didn't work. PostgreSQL surely makes something of > it, but not the right characters. maybe you should show us exacly what you did, and what you got, and what you expected > Unless Markus can make his idea using "decode" work, this might be > something pl/pgsql cannot do. did you try the function I posted yesterday elsewhere in this thread? gnari From Bart.Degryse@indicator.be Thu Nov 30 08:15:56 2006 Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id D2DEF9FB1CF for ; Thu, 30 Nov 2006 04:15:56 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 49480-05 for ; Thu, 30 Nov 2006 04:15:52 -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 CE8B79FA492 for ; Thu, 30 Nov 2006 04:15:51 -0400 (AST) Received: from DOMEXT-MTA by webaccess.indicator.bewith Novell_GroupWise; Thu, 30 Nov 2006 09:15:48 +0100 Message-Id: <456EA13B.A3DD.0030.0@indicator.be> X-Mailer: Novell GroupWise Internet Agent 7.0.1 Date: Thu, 30 Nov 2006 09:15:40 +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><456B0A47020000300000FC1E@webaccess.in d i cator.be><456B0A47020000300000FC1E@webaccess.indicator.be> <456B0153.30106 03 @logix-tt.com> <456B132F020000300000FC4B@webaccess.indicator.be><456B1 32F 020000300000FC4B@webaccess.indicator.be><456B0A0A.2080009@archonet.com> <456B1ACF020000300000FC74@webaccess.indicator.be><456B1ACF020000300000FC74@ webaccess.indicator.be><456B13AE.1090100@archonet.com><456BFDEE.A3DD.0030. 0@indicator.be><456BFDEE.A3DD.0030.0@indicator.be><1164706098.27070.135.cam el@localhost.localdomain> In-Reply-To: <1164706098.27070.135.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=__PartECC8CA3C.3__=" 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/287 X-Sequence-Number: 26939 --=__PartECC8CA3C.3__= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Due to a lack of time, I'm closing the thread. It takes a little more code, but I've decided to just forget about the loop and write every single statement in my function. Thanks anyway for explaning and brainstorming. >>> Ragnar 2006-11-28 10:28 >>> On ₫ri, 2006-11-28 at 09:14 +0100, Bart Degryse wrote: > Yes, I tried and it didn't work. PostgreSQL surely makes something of > it, but not the right characters. maybe you should show us exacly what you did, and what you got, and what you expected > Unless Markus can make his idea using "decode" work, this might be > something pl/pgsql cannot do. did you try the function I posted yesterday elsewhere in this thread? gnari --=__PartECC8CA3C.3__= Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Description: HTML
Due to a lack of time, I'm closing the thread. It takes a little = more code, but I've decided to just forget about the loop and write every = single statement in my function.
Thanks anyway for explaning and brainstorming.

>>>= ; Ragnar <gnari@hive.is> 2006-11-28 10:28 >>>
On =FEri, = 2006-11-28 at 09:14 +0100, Bart Degryse wrote:
> Yes, I tried and it = didn't work. PostgreSQL surely makes something of
> it, but not the = right characters.

maybe you should show us exacly what you did, and = what
you got, and what you expected

> Unless Markus can make = his idea using "decode" work, this might be
> something pl/pgsql = cannot do.

did you try the function I posted yesterday elsewhere
= in this thread?

gnari


--=__PartECC8CA3C.3__=--