Re: Cast for text->Integer missing in 8.3.5 - Mailing list pgsql-general

From Tom Lane
Subject Re: Cast for text->Integer missing in 8.3.5
Date
Msg-id 28791.1231870080@sss.pgh.pa.us
Whole thread Raw
In response to Re: Cast for text->Integer missing in 8.3.5  ("Scott Marlowe" <scott.marlowe@gmail.com>)
List pgsql-general
"Scott Marlowe" <scott.marlowe@gmail.com> writes:
> On Tue, Jan 13, 2009 at 8:23 AM, Nykolyn, Andrew <andrew.nykolyn@ngc.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

pgsql-general by date:

Previous
From: Sam Mason
Date:
Subject: Re: Trying to create implicit casts to text in PG 8.3
Next
From: "Nykolyn, Andrew"
Date:
Subject: Re: Cast for text->Integer missing in 8.3.5