我想在 Python 中执行一个具有交叉表功能的 SQL 查询,但是我得到了这个错误信息:
psycopg2.ProgrammingError: function crosstab(unknown, unknown) does not exist HINT: No function matches the given name and argument types. You might need to add explicit type casts.
有解决办法吗?我已经尝试升级 psycopg2(pip install psycopg2 --upgrade)。 非常感谢
最佳答案
尝试在函数前面加上架构名称:
<<YourSchema>>.crosstab(....
如果没有安装扩展,并且您想从 psycopg2 运行查询来安装它,请在之后立即提交连接。
关于python psycopg2 - ProgrammingError : function crosstab(unknown, 未知)不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50802494/