Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 96CE96330DF for ; Thu, 26 Feb 2009 05:37:43 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 13432-04 for ; Thu, 26 Feb 2009 05:37:40 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.168]) by mail.postgresql.org (Postfix) with ESMTP id F1ABC632205 for ; Thu, 26 Feb 2009 05:37:39 -0400 (AST) Received: by wf-out-1314.google.com with SMTP id 23so523112wfg.28 for ; Thu, 26 Feb 2009 01:37:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.142.84.11 with SMTP id h11mr572523wfb.232.1235641058082; Thu, 26 Feb 2009 01:37:38 -0800 (PST) In-Reply-To: <49A65FA9.1000809@nsoft.lt> References: <8f750b7c0902260032u76d11ca8p1349fec8e899d36c@mail.gmail.com> <49A65FA9.1000809@nsoft.lt> Date: Thu, 26 Feb 2009 17:37:38 +0800 Message-ID: <8f750b7c0902260137n5d32f4b0scd4539654a084a83@mail.gmail.com> Subject: Re: String concatenation work in version 8.2.11 and 8.3.6 From: Tony Liao To: Julius Tuskenis Cc: pgsql-admin@postgresql.org Content-Type: multipart/alternative; boundary=001636e911305640f10463cf1a02 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200902/231 X-Sequence-Number: 31452 --001636e911305640f10463cf1a02 Content-Type: text/plain; charset=ISO-8859-13 Content-Transfer-Encoding: quoted-printable thanks,Julius. 2009/2/26 Julius Tuskenis > Hi Tony, > > Its not a bug - automatic casting was removed in 8.3. You should cast( a = as > text)||cast(b ... =3D cast(123456 as text). Other option is to define you= r own > operators which is to be used only in case you can not fix clients of you= r > database... > > Tony Liao ra=F0=EB: > > hi,all >> for example tableA >> create table tableA ( >> id serial, >> a integer, >> b integer, >> c integer >> ); >> insert into tableA (a,b,c) values (12,34,56); >> >> then, >> select id from tableA where (a||b||c)=3D123456; >> in postgresql version 8.2.11,it works. >> but in postgresql version 8.3.6,the error as bellow: >> ERROR: operator does not exist: integer || integer >> LINE 1: select id from tableA where (a||b||c)=3D123456; >> ^ >> HINT: No operator matches the given name and argument type(s). Yo= u >> might need to add explicit type casts. >> >> is it a bug in 8.2.11 or I install 8.3.6 not completely? >> > > > -- > Julius Tuskenis > Programavimo skyriaus vadovas > UAB nSoft > mob. +37068233050 > > --001636e911305640f10463cf1a02 Content-Type: text/html; charset=ISO-8859-13 Content-Transfer-Encoding: quoted-printable thanks,Julius.
=A0=A0=A0=A0=A0=A0=A0

= 2009/2/26 Julius Tuskenis <julius@nsoft.lt>
Hi Tony,

Its not a bug - automatic casting was removed in 8.3. You should cast( a as= text)||cast(b ... =3D cast(123456 as text). Other option is to define your= own operators which is to be used only in case you can not fix clients of = your database...

Tony Liao ra=F0=EB:

hi,all
=A0 =A0 =A0for example tableA
=A0 =A0 =A0create table tableA (
=A0 =A0 =A0 id serial,
=A0 =A0 =A0 a integer,
=A0 =A0 =A0 b integer,
=A0 =A0 =A0 c integer
=A0 =A0 =A0);
=A0 =A0 =A0insert into tableA (a,b,c) values (12,34,56);

then,
=A0 =A0 =A0select id from tableA where (a||b||c)=3D123456;
=A0 =A0 =A0in postgresql version 8.2.11,it works.
=A0 =A0 =A0but in postgresql version 8.3.6,the error as bellow:
=A0 =A0 =A0 ERROR: =A0operator does not exist: integer || integer
=A0 =A0 =A0 LINE 1: select id from tableA where (a||b||c)=3D123456;
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0^
=A0 =A0 =A0 HINT: =A0No operator matches the given name and argument type(= s). You might need to add explicit type casts.

is it a bug in 8.2.11 or I install 8.3.6 not completely?


--
Julius Tuskenis
Programavimo skyriaus vadovas
UAB nSoft
mob. +37068233050


--001636e911305640f10463cf1a02--