我正在用C语言编写一个针对PostgreSQL的扩展程序,需要在我的用户定义函数中使用hstore。 我可以构建它而不出现错误(使用pgxc),但无法在SQL查询中使用任何函数。
我尝试了PG_LIBS=hstore
,但在加载库时出现未定义引用错误。
接下来尝试的是SHLIB_LINK=-L/usr/lib/postgresql/9.1/lib -lhstore
(系统中不存在libhstore.so,只有hstore.so,因此我尝试使用符号链接和硬链接),但得到了
psql:libname.sql:69: ERROR: could not load library
"/usr/lib/postgresql/9.1/lib/libname.so": libhstore.so: cannot open shared
object file: No such file or directory