pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
String concatenation work in version 8.2.11 and 8.3.6
3+ messages / 2 participants
[nested] [flat]

* String concatenation work in version 8.2.11 and 8.3.6
@ 2009-02-26 08:32  Tony Liao <tonyliao@yuehetone.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Tony Liao @ 2009-02-26 08:32 UTC (permalink / raw)
  To: pgsql-admin

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)=123456;
      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)=123456;
                                      ^
       HINT:  No 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?

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: String concatenation work in version 8.2.11 and 8.3.6
@ 2009-02-26 09:23  Julius Tuskenis <julius@nsoft.lt>
  parent: Tony Liao <tonyliao@yuehetone.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Julius Tuskenis @ 2009-02-26 09:23 UTC (permalink / raw)
  To: Tony Liao <tonyliao@yuehetone.com>; +Cc: pgsql-admin

Hi Tony,

Its not a bug - automatic casting was removed in 8.3. You should cast( a 
as text)||cast(b ... = 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šė:
> 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)=123456;
>       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)=123456;
>                                       ^
>        HINT:  No 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




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: String concatenation work in version 8.2.11 and 8.3.6
@ 2009-02-26 09:37  Tony Liao <tonyliao@yuehetone.com>
  parent: Julius Tuskenis <julius@nsoft.lt>
  0 siblings, 0 replies; 3+ messages in thread

From: Tony Liao @ 2009-02-26 09:37 UTC (permalink / raw)
  To: Julius Tuskenis <julius@nsoft.lt>; +Cc: pgsql-admin

thanks,Julius.


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 ... = 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ðë:
>
>  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)=123456;
>>      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)=123456;
>>                                      ^
>>       HINT:  No 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
>
>

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2009-02-26 09:37 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2009-02-26 08:32 String concatenation work in version 8.2.11 and 8.3.6 Tony Liao <tonyliao@yuehetone.com>
2009-02-26 09:23 ` Julius Tuskenis <julius@nsoft.lt>
2009-02-26 09:37   ` Tony Liao <tonyliao@yuehetone.com>

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