Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qbpW6-00D8IM-SM for pgsql-general@arkaria.postgresql.org; Thu, 31 Aug 2023 21:47:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qbpW4-00A3FC-V0 for pgsql-general@arkaria.postgresql.org; Thu, 31 Aug 2023 21:47:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qbpW4-00A3Ew-GU for pgsql-general@lists.postgresql.org; Thu, 31 Aug 2023 21:47:52 +0000 Received: from mout-u-107.mailbox.org ([2001:67c:2050:101:465::107]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qbpW0-0022Uk-Ka for pgsql-general@lists.postgresql.org; Thu, 31 Aug 2023 21:47:50 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [10.196.197.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-107.mailbox.org (Postfix) with ESMTPS id 4RcFBj41Nmz9sRv; Thu, 31 Aug 2023 23:47:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ewie.name; s=MBO0001; t=1693518461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tddwfrvfdj/2lTS2tMMhdZv7UJC8GOgamCuerdmOPZc=; b=BHR+BnKZnwmJHbsMBrrVpWfc3f557nFAWKatQtwz3DHlmXlBPe8dy16MNn/H/F81pY9ggd j8k6wsKPysmYJFb4qTBp+5BjZkiv0MSHAMR6DEIyWci3QbDsReK6nKYPJBbqUBZOGpsqMR BYM9Ph9g0VODgKhg5zIf8+05Q+MD1yxxNLTmB53gEwXL6OT06ThJHRJ+OTTXbId0kzmxX/ egfmFLxXisFxWWseKX2vnaSMrGXx0GrBbFcs1e3aKZAuc49ZmdP/SQWcdZHRX/ldnrZTJ0 Vx+bxuTHT53OR0wmXvB4xfOcIyFklBq8mG2aSzyEIGXTaGd9sDtoa16Qcnh6XA== Date: Thu, 31 Aug 2023 23:47:40 +0200 (CEST) From: Erik Wienhold To: Arthur Bazin , pgsql-general@lists.postgresql.org Message-ID: <1686822272.145805.1693518460997@office.mailbox.org> In-Reply-To: References: Subject: Re: pg_dump/pg_restore and the magic of the search_path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 31/08/2023 17:08 CEST Arthur Bazin wrote: > > Consider that we have a function in the public schema witch is named > my_function_in_public. > > In PG11 this table : > CREATE TABLE public.test_dump ( > id TEXT DEFAULT my_function_in_public() > ); > When you dump this table with the pg11 binaries, you obtain this script : > CREATE TABLE public.test_dump ( > id TEXT DEFAULT public.my_function_in_public() > ); > => the schema prefix have been added to the function by pg_dump. > > In PG13, the same table : > CREATE TABLE public.test_dump ( > id TEXT DEFAULT my_function_in_public() > ); > When you dump this table with the pg13 binaries, you obtain this script : > CREATE TABLE public.test_dump ( > id TEXT DEFAULT my_function_in_public() > ); > => the schema prefix have not been added. Are you sure that my_function_in_public was created in schema public on pg13? I cannot reproduce this on 13.12. However, I can reproduce it when creating that function in pg_catalog instead of public. The dump does not include pg_catalog.my_function_in_public though. -- Erik