【发布时间】:2014-05-03 12:30:07
【问题描述】:
我正在尝试在 PostgreSQL 9.3.3 上安装 Multicorn 扩展,但我遇到的问题是此扩展仅适用于 Python 2.7 或 3.3,而我的操作系统 (Centos 6.5) 上的默认 python 版本是 2.6,而我在不破坏整个系统的情况下无法更改它。
我已经在默认版本旁边安装了 python 2.7,并从 source 编译了 Multicorn 扩展,将 makefile 中的 python 引用/路径更改为 python 2.7,但是我在 Postgres 中使用扩展时遇到了问题。
创建扩展命令可以正常工作:
CREATE EXTENSION multicorn;
创建服务器,但是失败:
CREATE SERVER csv_srv foreign data wrapper multicorn options (wrapper 'multicorn.csvfdw.CsvFdw');
ERROR: Error in python: ImportError
DETAIL: No module named multicorn
是否有解决此问题的方法或至少提示要查找的内容?
我的假设是,即使扩展本身是参考 python 2.7 编译的,并且所有文件都复制到正确的文件夹/usr/local/lib/python2.7/dist-packages/multicorn-1.0.2-py2.7-linux-x86_64.egg/multicorn,PostgreSQL 本身仍然使用系统默认的 python 2.6 版本,因此无法加载模块。有没有办法覆盖 Postgres 使用的 python 版本?这样能解决问题吗?
【问题讨论】:
标签: python postgresql centos foreign-data-wrapper multicorn