I have locked down access to all dblink_* functions, so that only
certain privileged users have access to them, and instead provide a set
of SRF functions defined as security definer functions, where I connect
to the remote server, fetch some data, disconnect from remote server,
and return the data.
One obvious disadvantage of this approach, is that I need to connect and
disconnect in every function. A possible solution to this, would be
having a function f.ex dblink_exists('connection_name') that returns
true/false depending on whether the connection already exists. This
way, I could just check if a named connection exists, and establish a
connection if not, and wait until the end of the session to disconnect
all established connections.
I've attached a patch with a suggested implementation of such a function.
pgsql-hackers by date
|Next:||From: Simon Riggs||Date: 2008-05-28 08:25:54|
|Subject: Re: Hint Bits and Write I/O|
|Previous:||From: Radek Strnad||Date: 2008-05-28 00:22:39|
|Subject: Proposal - Collation at database level|