开发者

PostgreSQL Accessing multiple database from stored function

开发者 https://www.devze.com 2023-01-29 16:24 出处:网络
I want to access different databases from postgresql stored functions. For example: CREATE O开发者_开发问答R REPLACE FUNCTION test ()RETURNS SETOF volume AS

I want to access different databases from postgresql stored functions.

For example:

CREATE O开发者_开发问答R REPLACE FUNCTION test ()  RETURNS SETOF volume AS
$BODY$

SELECT * FROM db2.volume
ORDER BY db2.volume.volumeID

$BODY$  
LANGUAGE sql STABLE  
COST 100  
ROWS 1000;

any input will be great help.

Regards, Manasi


what you need is database link

0

精彩评论

暂无评论...
验证码 换一张
取 消