我很困惑,我在我的本地Postgres服务器(postgres.app, Mac OS X 10.7)上创建存储过程时遇到了问题,如下:
$ psql
psql (9.3.0)
Type "help" for help.
dchaston=# CREATE OR REPLACE FUNCTION table_update()
dchaston-# RETURNS TRIGGER AS $$
dchaston$# BEGIN
dchaston$# NEW.last_edit = now();
dchaston$# RETURN NEW;
dchaston$# END;
dchaston$# $$ language 'plpgsql';
ERROR: could not access file "$libdir/plpgsql": No such file or directory
I've checked the following:
Languages installed:
dchaston=# select * from pg_language;
lanname | lanowner | lanispl | lanpltrusted | lanplcallfoid | laninline | lanvalidator | lanacl
---------+----------+---------+--------------+---------------+-----------+--------------+--------
internal | 10 | f | f | 0 | 0 | 2246 |
c | 10 | f | f | 0 | 0 | 2247 |
sql | 10 | f | t | 0 | 0 | 2248 |
plpgsql | 10 | t | t | 12019 | 12020 | 12021 |
(4 rows)
lib目录(同时也是pkglibdir):
$ pg_config --libdir
/Applications/Postgres.app/Contents/MacOS/lib
$ pg_config --pkglibdir
/Applications/Postgres.app/Contents/MacOS/lib
文件已存在:
$ cd /Applications/Postgres.app/Contents/MacOS/lib; ls plpg*
plpgsql.so
正确设置DLSUFFIX:
lib/pgxs/src/Makefile.shlib:135: DLSUFFIX = .so
我已尝试卸载并重新安装,但没有任何改变。有什么建议吗?