我使用的是postgresql 8.2.22版本,然后我升级到postgresql 9.1.3,升级成功完成。
但是现在一些演员表的工作方式与以前不同!
在 Postgres 8.2.22
我运行这两个查询,它们都正常工作:
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)
升级到 Postgres 9.1.3 后
我运行相同的查询,现在它们抛出错误:
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
为什么在 postgresql 中的转换不像以前那样工作?