Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kmgWk-0006Ks-TZ for pgsql-admin@arkaria.postgresql.org; Tue, 08 Dec 2020 17:11:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kmgWj-0000Uw-N6 for pgsql-admin@arkaria.postgresql.org; Tue, 08 Dec 2020 17:11:49 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kmgWj-0000Up-Fm for pgsql-admin@lists.postgresql.org; Tue, 08 Dec 2020 17:11:49 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kmgWe-0000hC-I9 for pgsql-admin@lists.postgresql.org; Tue, 08 Dec 2020 17:11:48 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 0B8HBh803256927; Tue, 8 Dec 2020 12:11:43 -0500 From: Tom Lane To: Mai Peng cc: pgsql-admin@lists.postgresql.org Subject: Re: Auto-analyse vs manual analyze In-reply-to: <48106937-7FA8-4868-887C-EE697E422DB0@webedia-group.com> References: <48106937-7FA8-4868-887C-EE697E422DB0@webedia-group.com> Comments: In-reply-to Mai Peng message dated "Tue, 08 Dec 2020 18:00:07 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3256925.1607447503.1@sss.pgh.pa.us> Date: Tue, 08 Dec 2020 12:11:43 -0500 Message-ID: <3256926.1607447503@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Mai Peng writes: > Is there a difference between an autoanalyze and a manual analyze ? autoanalyze runs with a restrictive search_path setting. > I got an error when I simply select from a function This suggests that your function isn't being sufficiently careful to schema-qualify names it uses. (If you don't want to change the function text, adding a SET clause to force the desired search_path would work, though it does carry a bit of performance penalty.) regards, tom lane