我已经创建了函数 pgsql:
函数名称:fn_add_xyz(integer,bit,boolean,text)
。
当我们调用上面的函数时
调用函数:select * from fn_add_xyz(1,'1','true','hello');
在window XP下通过java应用程序.it works properly.
但是当我们在 Win server 2003 中通过相同的 Java 应用程序调用上述函数时。它给出了错误:
org.postgresql.util.PSQLException: ERROR: function fn_add_xyz(integer,character varying,character varying,text)does not exist
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
此问题发生在客户端环境中。我们已经在我们的环境中对此进行了测试,它工作正常。
最佳答案
当您尝试调用 fn_add_xyz(integer, text, text, text) 时,函数定义为 fn_add_xyz(integer, bit, boolean, text)。
尝试进行与您的函数签名匹配的显式转换和/或删除 bool 值两边的引号:
SELECT * FROM fn_add_xyz(1, '1'::bit, true, 'hello');
关于postgresql - 将字符串值传递给位数据类型在 Windows XP 中正常工作但在 Win Server 2003 中不正常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4386013/