Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f6Ghw-0007Yz-HJ for pgsql-general@arkaria.postgresql.org; Wed, 11 Apr 2018 14:26:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f6Ghu-0000Cz-VD for pgsql-general@arkaria.postgresql.org; Wed, 11 Apr 2018 14:26:42 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f6Ght-0000Cj-MV for pgsql-general@lists.postgresql.org; Wed, 11 Apr 2018 14:26:42 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f6Ghm-00015L-L0 for pgsql-general@lists.postgresql.org; Wed, 11 Apr 2018 14:26:40 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 5F32B21909; Wed, 11 Apr 2018 10:26:33 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 11 Apr 2018 10:26:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=sxV+ZZy1mQvTSATXeTcFI5KRwXNuK 4LrV3KPVoWBDzE=; b=VyeJMKsjAFgxoNClC1I9EQji63vVmMtAV3ae4vbuIMvhp CW6NDTy3o4ij7w6Jpa7GfTolhBQxO6/fg6dMkd1DsRAL0sQXta8mT+kuCC3yA9T8 4R8DppWK4WlY3mw7bQITfefnqVmLRoLdX5HaejB7hzKQvEXjEfMsAeNtjdjDKilp HdLuZ45oimLOBT9ffoGnnKAM63C+uVasgd36TjOB5WA3qDuiDuw4KfhHS25qXLzm nV1E0btCem4Wii9bdTX62QNJyLLwehilIa8Gz2ZYBGtsxkHyQs8Qh06wq/yhkDvy gA8+nQYKLeLAEjTu02nAJwtqAfuyUeG/XPQUhKQ7w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=sxV+ZZ y1mQvTSATXeTcFI5KRwXNuK4LrV3KPVoWBDzE=; b=mD/49UaqT+ivlOLf4z5+9w ziBbX+YrxuZzCQ3gQdp5aVTrMpxu3nTWgNxMfs/abK4Hs+mnLqm5UlU2nrSOsUaQ X+IGhrblUbtGpOS2i5cUV3kkWqLP+XImQw2vbZgOpkB69vs8J2+sxmr3eY/MABD/ gjshDIN8QAka1znGcbXVHtumnvBSa/nQpnJ2DirhHjfPColrz7lEfFdAf0abOSjE fGvigmEH993UJkrDAbA4Tw9WVg5rR0OWupL0sEffOZbm58elyF16aE9T+iHVOUVG wRmwUc9Nes3GbmTGnvyOQFd2JIdt5KZRa2DMHE6fUzzlu3bIbsI4ayfR5oL6cV8g == X-ME-Sender: Received: from [192.168.1.2] (71-35-123-124.tukw.qwest.net [71.35.123.124]) by mail.messagingengine.com (Postfix) with ESMTPA id CC6AEE508F; Wed, 11 Apr 2018 10:26:32 -0400 (EDT) Subject: Re: dblink: give search_path To: Thiemo Kellner , pgsql-general References: <20180411084417.11492xo2gdx9zni8@www.gelassene-pferde.biz> From: Adrian Klaver Message-ID: <2b63fb34-7057-d734-bdcc-284bd5c34e61@aklaver.com> Date: Wed, 11 Apr 2018 07:26:32 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180411084417.11492xo2gdx9zni8@www.gelassene-pferde.biz> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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