Re: [GENERAL] cast problem in Postgresql 9.0.1

2011-02-01 Thread Tom Lane
"Joshua D. Drake" writes: > On Tue, 2011-02-01 at 12:14 +0600, AI Rumman wrote: >> I migrated my DB from Postgresql 8.1 to Postgresql 9.0.1. >> >> I have a table "testtab" >> \d testtab >> id int, >> hours varchar >> >> When I execute the following: >> select sum(hours) from testtab >> I get cas

Re: [GENERAL] cast problem in Postgresql 9.0.1

2011-02-01 Thread Joshua D. Drake
On Tue, 2011-02-01 at 12:14 +0600, AI Rumman wrote: > I migrated my DB from Postgresql 8.1 to Postgresql 9.0.1. > > I have a table "testtab" > \d testtab > id int, > hours varchar > > When I execute the following: > select sum(hours) from testtab > I get cast error. > In 8.3, implicit casts were

Re: [GENERAL] cast problem in Postgresql 9.0.1

2011-02-01 Thread Alban Hertroys
On 1 Feb 2011, at 7:14, AI Rumman wrote: > I migrated my DB from Postgresql 8.1 to Postgresql 9.0.1. That's quite a big step up. You skipped 8.2, 8.3 and 8.4 - all major releases. My advise: Test very thoroughly for more differences in behaviour. One thing to start looking at right away is whet

Re: [GENERAL] cast problem in Postgresql 9.0.1

2011-02-01 Thread Adrian Klaver
On Monday, January 31, 2011 10:14:29 pm AI Rumman wrote: > I migrated my DB from Postgresql 8.1 to Postgresql 9.0.1. > > I have a table "testtab" > \d testtab > id int, > hours varchar > > When I execute the following: > select sum(hours) from testtab > I get cast error. Try: select sum(hours::i

[GENERAL] cast problem in Postgresql 9.0.1

2011-01-31 Thread AI Rumman
I migrated my DB from Postgresql 8.1 to Postgresql 9.0.1. I have a table "testtab" \d testtab id int, hours varchar When I execute the following: select sum(hours) from testtab I get cast error. Then, I created following IMPLICIT CAST functions in my DB => CREATE FUNCTION pg_catalog.integer(va