Skip site navigation (1) Skip section navigation (2)

Re: String concatenation work in version 8.2.11 and 8.3.6

From: Tony Liao <tonyliao(at)yuehetone(dot)com>
To: Julius Tuskenis <julius(at)nsoft(dot)lt>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: String concatenation work in version 8.2.11 and 8.3.6
Date: 2009-02-26 09:37:38
Message-ID: 8f750b7c0902260137n5d32f4b0scd4539654a084a83@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-admin
thanks,Julius.


2009/2/26 Julius Tuskenis <julius(at)nsoft(dot)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
>
>

In response to

pgsql-admin by date

Next:From: Tony LiaoDate: 2009-02-26 10:33:37
Subject: index for inet(ip address or ip range)
Previous:From: Julius TuskenisDate: 2009-02-26 09:23:53
Subject: Re: String concatenation work in version 8.2.11 and 8.3.6

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group