I was using postgresql version 8.2.22, then I upgraded to postgresql 9.1.3 and the upgrade was successfully completed.
But now some casts are not working the same as before!
In Postgres 8.2.22
I run these two queries and they both work correctly:
POSTGRES8222=# select TO_NUMBER('12345678',9999999999.99);
to_number
=========
12345678
(1 row)
POSTGRES8222=# select a ||'$'|| b from test;
?column?
----------
1$abcdef
2$ghijkl
3$3456
(3 rows)
After upgrade to Postgres 9.1.3
I run the same queries and now they throw errors:
select TO_NUMBER('12345678',9999999999.99);
ERROR: function to_number(unknown, numeric) does not exist
LINE 1: select TO_NUMBER('12345678',9999999999.99);
^
HINT: No function matches the given name and argument types. You might
need to add explicit type casts.
EXCEPTION
org.postgresql.util.PSQLException: ERROR: function to_number(numeric, numeric)
does not exist
Hint: No function matches the given name and argument types. You might need
to add explicit type casts.
Position: 150
select a ||'$'|| b from test;
ERROR: operator is not unique: numeric || unknown
LINE 1: select a ||'$'|| b from test;
^
HINT: Could not choose a best candidate operator. You might need to
add explicit type casts.
********** Error **********
ERROR: operator is not unique: numeric || unknown
SQL state: 42725
Hint: Could not choose a best candidate operator. You might need to
add explicit type casts.
Character: 10
Why is it that casting in postgresql is not working as it did before?