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 07:26:32 -0700
Message-ID: <2b63fb34-7057-d734-bdcc-284bd5c34e61@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.
In addition to my previous suggestions:
test=# SELECT public.dblink_connect('dbname=production ');
dblink_connect
----------------
OK
test=# select * from public.dblink('show search_path') as
t1(search_path text);
search_path
-------------
main
test=# select public.dblink_exec('set search_path=main,utility');
dblink_exec
-------------
SET
(1 row)
test=# select * from public.dblink('show search_path') as
t1(search_path text);
search_path
---------------
main, utility
>
> Function Schema: logger
> Database: act
> User: act
> User Default Schema: act
>
> Kind regards
>
> Thiemo
>
--
Adrian Klaver
adrian.klaver@aklaver.com
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: <2b63fb34-7057-d734-bdcc-284bd5c34e61@aklaver.com>
References: <20180411084417.11492xo2gdx9zni8@www.gelassene-pferde.biz> <2b63fb34-7057-d734-bdcc-284bd5c34e61@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