pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Thiemo Kellner <thiemo@gelassene-pferde.biz>
To: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: dblink: give search_path
Date: Wed, 11 Apr 2018 06:24:24 -0700
Message-ID: <a42ac116-97b7-1cbd-68a5-ffc9b748fc37@aklaver.com> (raw)
In-Reply-To: <20180411084417.11492xo2gdx9zni8@www.gelassene-pferde.biz>
References: <20180411084417.11492xo2gdx9zni8@www.gelassene-pferde.biz>

On 04/10/2018 11:44 PM, Thiemo Kellner wrote:
> Hi all
> 
> I try to execute a function not in the Schema I connect to with dblink. 
> Is there way to tell dblink to set search_path in a specific way? I have 
> not found a solution in the documentation. I tried with the set 
> search_path definition in the function declarations to no avail.

https://www.postgresql.org/docs/10/static/contrib-dblink-connect.html

"
Notes

If untrusted users have access to a database that has not adopted a 
secure schema usage pattern, begin each session by removing 
publicly-writable schemas from search_path. One could, for example, add 
options=-csearch_path= to connstr. This consideration is not specific to 
dblink; it applies to every interface for executing arbitrary SQL commands.
"

or schema qualify the function:

select logger.some_func();

> 
> Function Schema: logger
> Database: act
> User: act
> User Default Schema: act
> 
> Kind regards
> 
> Thiemo
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




view thread (6+ messages)  latest in thread

Message-ID: <a42ac116-97b7-1cbd-68a5-ffc9b748fc37@aklaver.com>
Permalink:  ../a42ac116-97b7-1cbd-68a5-ffc9b748fc37@aklaver.com/
Also on:    postgresql.org/message-id/a42ac116-97b7-1cbd-68a5-ffc9b748fc37@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, thiemo@gelassene-pferde.biz
  Subject: Re: dblink: give search_path
  In-Reply-To: <a42ac116-97b7-1cbd-68a5-ffc9b748fc37@aklaver.com>
  References: <20180411084417.11492xo2gdx9zni8@www.gelassene-pferde.biz> <a42ac116-97b7-1cbd-68a5-ffc9b748fc37@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox