pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Benjamin Krajmalnik <kraj@illumen.com>
To: pgsql-admin@postgresql.org
Subject: Change in behavior of string concat operator
Date: Sat, 6 Dec 2008 11:04:27 -0700
Message-ID: <F4E6A2751A2823418A21D4A160B689882B8AAF@fletch.stackdump.local> (raw)

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.
 

view thread (6+ messages)  latest in thread

Message-ID: <F4E6A2751A2823418A21D4A160B689882B8AAF@fletch.stackdump.local>
Permalink:  ../F4E6A2751A2823418A21D4A160B689882B8AAF@fletch.stackdump.local/
Also on:    postgresql.org/message-id/F4E6A2751A2823418A21D4A160B689882B8AAF@fletch.stackdump.local

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: kraj@illumen.com
  Subject: Re: Change in behavior of string concat operator
  In-Reply-To: <F4E6A2751A2823418A21D4A160B689882B8AAF@fletch.stackdump.local>
  References: <F4E6A2751A2823418A21D4A160B689882B8AAF@fletch.stackdump.local>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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