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 1sbIAG-00FU88-Tf for pgsql-admin@arkaria.postgresql.org; Tue, 06 Aug 2024 11:15:41 +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 1sbIAF-00EHwL-BC for pgsql-admin@arkaria.postgresql.org; Tue, 06 Aug 2024 11:15:39 +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 1sbIAE-00EHul-TT for pgsql-admin@lists.postgresql.org; Tue, 06 Aug 2024 11:15:38 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sbIAC-003MuN-1d for pgsql-admin@lists.postgresql.org; Tue, 06 Aug 2024 11:15:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Type:MIME-Version:References:Reply-To: Message-ID:Subject:Cc:To:Sender:From:Date:Content-Transfer-Encoding: Content-ID:Content-Description; bh=E8inUREmYfIL051RcNUdScMv7Y3fDrRMLBaLdiAiizY=; b=Y7KksUSaL403o9ePpXfZsvzbDS KmV+s9iRfkxsToImkQj0mCk1ORe2xIcJOHJf26clGOUyU+zE2681HHs9fX1amV9K86eqJjxxXxsbX YkR36L7V+eld6WJ5euBCJHbVCzBg9SOZYxHYpRMPhQpFrT5KNy5U9Q1Ef3OVQR4oq2/g=; Received: from depesz by depesz.com with local (Exim 4.96) (envelope-from ) id 1sbIA9-00DB0W-0M; Tue, 06 Aug 2024 13:15:33 +0200 Date: Tue, 6 Aug 2024 13:15:33 +0200 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: Sathish Reddy Cc: pgsql-admin@lists.postgresql.org Subject: Re: Pg_repack Message-ID: Reply-To: depesz@depesz.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Aug 06, 2024 at 04:39:53PM +0530, Sathish Reddy wrote: > We planning to create store procedure (function) in postgres database to > run pg_repack on removing bloating of table or index by using within > postgres instance. > Please help me on details on steps with example for same. That will be impossible and/or hard. The problem is that stored procedure/functions runs in database. and pg_repack is external program, that *does stuff in database*, but it not *all* in database. It's kinda as if you wanted to make stored procedure to run photoshop. You can kinda work around it by using some PL/* language that allows external program execution, but it is extremely unlikely to do what you'd think it will do. Best regards, depesz