ERROR: function dblink(unknown, unknown) does not exist

HuFlungPu picture HuFlungPu · Jun 19, 2018 · Viewed 12.5k times · Source

I have defined a foreign server pointing to another database. I then want to execute a function in that database and get back the results.

When I try this:

SELECT * FROM  dblink('mylink','select someschema.somefunction(''test'', ''ABC'')')

or this:

SELECT t.n FROM  dblink('mylink', 'select * from someschema.mytable') as t(n text)

I get the error:

ERROR: function dblink(unknown, unknown) does not exist

Running as superuser.

Answer

Roman Marusyk picture Roman Marusyk · Aug 5, 2019

You need to install an extension dblink

create extension dblink;