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 1f6Fjl-0003Vn-BB for pgsql-general@arkaria.postgresql.org; Wed, 11 Apr 2018 13:24:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f6Fjk-0005V2-72 for pgsql-general@arkaria.postgresql.org; Wed, 11 Apr 2018 13:24:32 +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 1f6Fjj-0005Ut-0n for pgsql-general@lists.postgresql.org; Wed, 11 Apr 2018 13:24:32 +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 1f6Fjf-00080z-07 for pgsql-general@lists.postgresql.org; Wed, 11 Apr 2018 13:24:29 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 1B26F20F62; Wed, 11 Apr 2018 09:24:26 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 11 Apr 2018 09:24:26 -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=PX2HDXWcaF+Nny9nuE9J82J6oZn3v x52uO3e3rGdXfQ=; b=RJbIxuORYQL9XHv6SfCwhyWLDLgIWv38605oQCegQXXbE UHd0GTVUu9ZCUz8n23ToGTM061+NSQi272DV11w95GVuoprg8mLew1IpyOxVueD3 dvpXqeacYvyni9B0rzc/RIwjwnWbwlvIAD6Ay2E+CZTJqmaX4CF1JRwg5/jrs/cA 98ODr2d3U0cp+wU7ZodtDCnImiqZB7GeWLxNelszHusoVSNNvU7zfy3s8Ne1sAIg rw6VLo5DoGDoKSHJ61T0nroxPTlDM7bpE+ygUKF6UUU/Dq3qzzRBZ/JDTqkKfRdc xWfHpgqunVeLyVAfOvHU0Wpnym38I9UydKnMmlEfg== 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=PX2HDX WcaF+Nny9nuE9J82J6oZn3vx52uO3e3rGdXfQ=; b=E8PKUvg2u78l3+3j6KdWPE 7K9ZtcOlO4uDjqkftC3U4Hr31LmiwOVNx1MZy/8qQSXTnnRp2NKxuwEs+BOJyDc5 HUmp9khXtMM1JIL+JISq2sxITC6KeBZSOwUmHXcYn9+6zEye7xtd0ZFz3NMp/1ft HZ1ODjmXaZ9HEwqZtJcxg+80RHehN334amHRG43zFbA+kGdpRsdSQWSwDWA2vONM fDJx04PXzlvh0ajHtBYcCDW5yKLblptPWvTH8C6VIULouaZHGPtJthQzfCwi8BwF O4G0jantUdd/EoUNkguaIQr2/ij3bBM9yiAOOttTmsQftOHXoh8z5DKiP/i8fATw == 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 4FEE9E5091; Wed, 11 Apr 2018 09:24:25 -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: Date: Wed, 11 Apr 2018 06:24:24 -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. 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