Cross-machine PL/pgSQL?

Started by David Olbersenabout 23 years ago3 messagesgeneral
Jump to latest
#1David Olbersen
DOlbersen@stbernard.com

Is it possible to access a postgres database running on another machine on the network from a pl/pgsql function? I haven't been able to find anything in the docs about this and have a feeling it just isn't going to happen :)

--------------------------
David Olbersen
iGuard Engineer
11415 West Bernardo Court
San Diego, CA 92127
1-858-676-2277 x2152

#2Alvaro Herrera
alvherre@dcc.uchile.cl
In reply to: David Olbersen (#1)
Re: Cross-machine PL/pgSQL?

On Tue, Mar 25, 2003 at 08:25:40AM -0800, David Olbersen wrote:

Is it possible to access a postgres database running on another
machine on the network from a pl/pgsql function? I haven't been able
to find anything in the docs about this and have a feeling it just
isn't going to happen :)

I guess you can use the contrib/dblink functions for this, but I'm not
sure.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"You knock on that door or the sun will be shining on places inside you
that the sun doesn't usually shine" (en Death: "The High Cost of Living")

#3Darko Prenosil
darko.prenosil@finteh.hr
In reply to: David Olbersen (#1)
Re: Cross-machine PL/pgSQL?

On Tuesday 25 March 2003 16:25, David Olbersen wrote:

Is it possible to access a postgres database running on another machine on
the network from a pl/pgsql function? I haven't been able to find anything
in the docs about this and have a feeling it just isn't going to happen :)

If You are well familiar with libpq client interface, there is my project on
gborg that encapsulates almost all libpq functions calls and can be used in
pl/psql.
ftp://gborg.postgresql.org/pub/plpq/devel/plpq_src.tar.gz

On the other hand, in /contrib directory of postgres sources there is dblink
tool that might be just what You want.

Show quoted text

--------------------------
David Olbersen
iGuard Engineer
11415 West Bernardo Court
San Diego, CA 92127
1-858-676-2277 x2152

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster