4

在我将 dblink.sql 执行到我的两个 Postgres 数据库后不久,我就能够成功地将 postgresql-contrib 安装到我的一台服务器上。安装 postgresql-contrib 后,我在以下位置找到了 dblink.sql:

/usr/share/pgsql/contrib/dblink.sql

现在,我正在尝试在另一台服务器上做同样的事情。然而,在安装 postgresql-contrib 之后,我找不到任何 db.sql 实例。两台服务器都运行 CentOS 6.2 和 PostgreSQL 9.1,尽管第二台服务器上的 PostgreSQL 安装位于另一个目录中:

PGENGINE=/usr/pgsql-9.1/bin
PGPORT=5432
PGDATA=/var/lib/pgsql/9.1/data
PGLOG=/var/lib/pgsql/9.1/pgstartup.log

当我执行“定位 dblink”时,我收到以下信息:

[root@dev-postgres dblink]# locate dblink
/usr/lib/debug/usr/pgsql-9.1/lib/dblink.so.debug
/usr/pgsql-9.1/share/man/man3/dblink.3
/usr/pgsql-9.1/share/man/man3/dblink_build_sql_delete.3
/usr/pgsql-9.1/share/man/man3/dblink_build_sql_insert.3
/usr/pgsql-9.1/share/man/man3/dblink_build_sql_update.3
/usr/pgsql-9.1/share/man/man3/dblink_cancel_query.3
/usr/pgsql-9.1/share/man/man3/dblink_close.3
/usr/pgsql-9.1/share/man/man3/dblink_connect.3
/usr/pgsql-9.1/share/man/man3/dblink_connect_u.3
/usr/pgsql-9.1/share/man/man3/dblink_disconnect.3
/usr/pgsql-9.1/share/man/man3/dblink_error_message.3
/usr/pgsql-9.1/share/man/man3/dblink_exec.3
/usr/pgsql-9.1/share/man/man3/dblink_fetch.3
/usr/pgsql-9.1/share/man/man3/dblink_get_connections.3
/usr/pgsql-9.1/share/man/man3/dblink_get_notify.3
/usr/pgsql-9.1/share/man/man3/dblink_get_pkey.3
/usr/pgsql-9.1/share/man/man3/dblink_get_result.3
/usr/pgsql-9.1/share/man/man3/dblink_is_busy.3
/usr/pgsql-9.1/share/man/man3/dblink_open.3
/usr/pgsql-9.1/share/man/man3/dblink_send_query.3
/usr/src/debug/postgresql-9.1.4/contrib/dblink
/usr/src/debug/postgresql-9.1.4/contrib/dblink/dblink.c

...没有 dblink.sql。有谁知道我可以在这里做什么?我是否必须以某种方式构建 sql 文件?如果是这样,你知道我该怎么做吗?

谢谢!

4

2 回答 2

4

它应该在 9.1 中作为扩展捆绑在一起

http://www.postgresql.org/docs/current/static/contrib.html

于 2012-08-27T22:27:19.500 回答
1

Just as a note, the shift to the extension system in 9.1 is a much needed change, but it causes a lot of headaches for many people actually trying to support multiple versions of PostgreSQL while relying on contrib modules. We have struggled with this on LedgerSMB 1.3 for months.

A lot of stuff can change between major versions of the software. I highly recommend following the release notes in major versions carefully before updating or just assuming everything will be the same. These are long, complicated documents but they ought to give you an idea of where you will run into problems and where you need to further check the new docs. If you are testing a deployment first (always a good idea!) it will also give you a much better idea of where to spend extra effort testing.

于 2012-08-28T06:02:01.190 回答