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

Change in behavior of string concat operator

From: "Benjamin Krajmalnik" <kraj(at)illumen(dot)com>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: Change in behavior of string concat operator
Date: 2008-12-06 18:04:27
Message-ID: F4E6A2751A2823418A21D4A160B689882B8AAF@fletch.stackdump.local (view raw or flat)
Thread:
Lists: pgsql-admin
I just migrated from 8.1 to 8.3, running on FreeBSD 7.0 amd64.
Running 8.3.5
 
I have a query concatenating 3 columns to create a hash.
userid is a numeric(38,0) field, accountno is an integer, and
requestdate is a date.
 
Under 8.1,  Select userid || accountno || requestdate::date as newcolumn
from table executed ok.
Under 8.3, it gives the following error:
 
operator does not exist: numeric || integer
 
Typecasting the first two columns to varchar resolved the problem.
 
Select userid::varchar || accountno::varchar || requestdate::date as
newcolumn from table 
At the very least, the documentation should be updated to reflect the
new behavior, although I believe this is a bug.
 

Responses

pgsql-admin by date

Next:From: Milen A. RadevDate: 2008-12-06 19:49:01
Subject: Re: Change in behavior of string concat operator
Previous:From: Dan ScottDate: 2008-12-05 15:42:28
Subject: Change user password

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