Re: Cast for text->Integer missing in 8.3.5

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
Cc: "Nykolyn, Andrew" <andrew(dot)nykolyn(at)ngc(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Cast for text->Integer missing in 8.3.5
Date: 2009-01-13 18:08:00
Message-ID: 28791.1231870080@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com> writes:
> On Tue, Jan 13, 2009 at 8:23 AM, Nykolyn, Andrew <andrew(dot)nykolyn(at)ngc(dot)com> wrote:
>> I am trying to upgrade my Postgres server from 8.2.3 to 8.3.5 and have found
>> that the cast text->integer and integer->text are missing. Is there a
>> reason why they are not there and how can I get them back. I have many
>> stored procedures that rely on those casts

> They were removed because the output was unpredictable. It's far
> better to spend your time fixing your code than trying to reinstate
> buggy / questionable behaviour.

To clarify: those casts are not *gone*, they just don't occur implicitly
anymore. You should put explicit casts into your functions in those
places where you actually intend an integer to be converted to text or
vice versa. Don't be surprised if this turns up some bugs in your code,
ie places where you didn't really intend the semantics you were getting.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jason Long 2009-01-13 18:34:09 Use PSQLFS for photo storage
Previous Message Sam Mason 2009-01-13 17:37:51 Re: Trying to create implicit casts to text in PG 8.3