Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hkuBO-0001O5-0S for pgsql-general@arkaria.postgresql.org; Tue, 09 Jul 2019 17:45:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hkuBM-00054j-0H for pgsql-general@arkaria.postgresql.org; Tue, 09 Jul 2019 17:45:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hkuBK-0004xN-FM for pgsql-general@lists.postgresql.org; Tue, 09 Jul 2019 17:45:35 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hkuB3-00012N-5G for pgsql-general@postgresql.org; Tue, 09 Jul 2019 17:45:33 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 751842244E; Tue, 9 Jul 2019 13:45:15 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 09 Jul 2019 13:45:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=O OZ/DEP+8VwPDtJnxwVTgdd0nslbVGjtedSyqs3GTFc=; b=S9cZ6hF9uSVDvmpfX yX8ERF8Npl4OdqpcwJ9T3WBrT5+t1G42sEeo8VF7/51fM+c1ME4du/ayLhfiTf9f homYI4ZcDBDVpiXSIuMny2Tr+4cB2P610uDPfjZ15LDAVnkh0n3QMwbCmlWdou2r Bzof3cxgqhhxWyaVrYAFWfsS2dqJe/9Cnw9vU/fPoLtSY/yu960YyLeT6zO8dNoa iOEGLMtycJnSMzha6NmncjfcZEeJ/JArVmgE8zhcOTRp+d501dkkYt5WIaJ7JbDo syo0jaq2dE0yQJefFMTLcwWBE2p96ERAn69GTMkyoikE1LnEltetmgqUHcGCzRwJ GCcBg== 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-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=OOZ/DEP+8VwPDtJnxwVTgdd0nslbVGjtedSyqs3GT Fc=; b=IYudA2ncBHXy3NjWbZc1ZtJbr4t/brped6BBkpNOSzkeZKB2Y0zcm69h2 m3UNmLIZGSe0f0LipCqRlbJLVbSop5owNheU17yAfdg4nENNKQqvag1VLFFiFha2 HLQDtCvbjk22LIUif223JBRciwH6XEsgCV2smCMGSUm4FMuEqye0hZz2lCHuW8eu i7CDvYLK2LtuXdVypd6EvDYDP5/jSBPHfkPszc+bPsvfdVAq+/8YT3i7peCYPuuT zO26Rlcv4je2B3sKqTulOJLoju3wiQit7Xhz3prnV47QIRsU9+hnCayxKbVCEdNv pNpqrrOQnl3QKtHks8ohHVJEXvAhw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrgedvgdduudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucffohhmrghinheplhhutggvvgdrohhrghenucfkphepjeefrddvfeelrdduudej rddvfeeknecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrse grkhhlrghvvghrrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from ranger.suse (c-73-239-117-238.hsd1.wa.comcast.net [73.239.117.238]) by mail.messagingengine.com (Postfix) with ESMTPA id 46A6338008A; Tue, 9 Jul 2019 13:45:14 -0400 (EDT) Subject: Re: pg_dump and search_path To: "Igal @ Lucee.org" , pgsql-general References: <1f5111a5-e49e-e44a-67df-b367e5d31fdf@lucee.org> <94e28e8c-e5cf-f0b5-a148-43452446d9ec@aklaver.com> From: Adrian Klaver Message-ID: <126613fd-e0a9-c79f-a400-028107214439@aklaver.com> Date: Tue, 9 Jul 2019 10:45:12 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 7/9/19 7:41 AM, Igal @ Lucee.org wrote: > On 7/9/2019 7:02 AM, Adrian Klaver wrote: >> On 7/8/19 11:48 PM, Igal @ Lucee.org wrote: >>> I have a custom search_path: >>> >>> # show search_path; >>>             search_path >>> ---------------------------------- >>>   "staging, transient, pg_catalog" >>> (1 row) >>> >>> I ran `pg_dump --schema-only` and the only reference in the output to >>> search_path is: >>> >>>    SELECT pg_catalog.set_config('search_path', '', false); >>> >>> Then one of my functions which does not reference the full name of a >>> table with its schema fails with "relation [rel-name] does not exist". >> >> Where is this failing? >> >> Do you have the search_path set in the config for the server you are >> dumping to? > > It is failing during the Restore operation.  I can provide more > information if I'll understand what you mean exactly by "Where". Yes, because I cannot replicate with just a function: CREATE OR REPLACE FUNCTION public.search_path_test(integer) RETURNS integer LANGUAGE plpgsql AS $function$ BEGIN perform * from test_tbl; RETURN 1; END; $function$ test_(postgres)# \d test_tbl Table "test_schema.test_tbl" Column | Type | Collation | Nullable | Default --------+---------+-----------+----------+--------- id | integer | pg_dump -d test -U postgres -x -p 5412 -Fc -f dump_search_path.out pg_restore --single-transaction -d test -c -U postgres -p 5412 dump_search_path.out SELECT pg_catalog.set_config('search_path', '', false); postgres-2019-07-09 10:37:32.488 PDT-604LOG: statement: CREATE FUNCTION public.search_path_test(integer) RETURNS integer LANGUAGE plpgsql AS $$ BEGIN perform * from test_tbl; RETURN 1; END; $$; postgres-2019-07-09 10:37:32.489 PDT-604LOG: statement: ALTER FUNCTION public.search_path_test(integer) OWNER TO aklaver; My guess is the function is being used somewhere. > > search_path is not set int he config, but rather with ALTER DATABASE SET > search_path TO ... but I have executed that prior to the RESTORE on the > target database.  Would it make a difference if I set it in the config? > > Thanks, > > Igal > > > -- Adrian Klaver adrian.klaver@aklaver.com