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

Re: Getting back the autocast on non-character via CREATE CAST

From: Adrian Klaver <aklaver(at)comcast(dot)net>
To: pgsql-general(at)postgresql(dot)org
Cc: Александър Шопов <ash(at)contact(dot)bg>
Subject: Re: Getting back the autocast on non-character via CREATE CAST
Date: 2008-11-28 15:47:30
Message-ID: 200811280747.30643.aklaver@comcast.net (view raw or flat)
Thread:
Lists: pgsql-general
On Thursday 27 November 2008 8:17:10 pm Александър Шопов wrote:
> Hi everyone,
> In pg 8.2 to 8.3 transition there is a new behavior: Non-character data
> types are no longer automatically cast to TEXT
>
> I understand the reasons, however while we manage to migrate the our
> system, is there a way to get back this behavior? I searched the
> internet and the mailing lists but I found no other solution but
> installing back 8.2.
>
> I tried to do the following:
>
> create table test (i integer);
>
> insert into test values (1);
>
> select * from test where i = (case when '0'<>'' then '1' else null end);

Try:
select * from test where i = (case when '0'<>'' then '1' else null end)::int;

>
>
> ERROR:  operator does not exist: integer = text
> LINE 1: select * from test where i = (case when '0'<>'' then '1' els...
>                                    ^
> HINT:  No operator matches the given name and argument type(s). You
> might need to add explicit type casts.
>
>


>
> Kind regards:
> al_shopov



-- 
Adrian Klaver
aklaver(at)comcast(dot)net

In response to

pgsql-general by date

Next:From: Alvaro HerreraDate: 2008-11-28 15:48:55
Subject: Re: Very large tables
Previous:From: William TemperleyDate: 2008-11-28 15:40:35
Subject: Very large tables

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