0

I have an application that uses PostgreSQL but also interacts with a third-party-controlled database on MSSQL. The data are sometimes tied together closely enough that it becomes desirable to do things like:

select thing_from_pg, thing_from_ms_crossover_function(thing_from_pg) -- etc

Currently I implement thing_from_ms_crossover_function in plperl. Is there a way to do this in plpgsql or something, so that I don't need to start a plperl interpreter for such cases?

Another option is obviously to access both databases from my client app, but that becomes far less convenient than the view syntax above.

4

1 回答 1

1

你有两个基本选项,三个基本选项。

第一个是使用DBI-Link然后通过您的 pl/pgsql 或 pl/perl 函数访问它。好处DBI-Link是它相对较老和成熟。如果它适合你,我会从那里开始。

第二种选择是使用外部数据包装器。

第三种选择是编写一个更通用的框架pl/perl,您可以从pl/pgsql. 但是,那时您基本上是在考虑重新发明 DBI-Link,所以我认为您最好从 DBI-Link 开始并根据需要对其进行修改。

于 2013-04-22T06:26:47.290 回答