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 1lzxbB-00027z-L5 for pgsql-admin@arkaria.postgresql.org; Sun, 04 Jul 2021 08:35:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lzxbA-0004W4-LB for pgsql-admin@arkaria.postgresql.org; Sun, 04 Jul 2021 08:35:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lzxbA-0004Vu-9o for pgsql-admin@lists.postgresql.org; Sun, 04 Jul 2021 08:35:32 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lzxb7-000745-Su for pgsql-admin@postgresql.org; Sun, 04 Jul 2021 08:35:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Reply-To:Message-ID:Subject:Cc:To:Sender:From:Date: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=kj294A6+2C6mgjctnGnvg9kTCZSme8D6E8a0Xk4A2bM=; b=nMqTSkCs4tnObBrEp+rYG/pGez /+u1kQkZRWv5QNPcOiMLneJp6KXiwfZ4xVD+wGKjTF5NBfLo+iy5BibvkoplzjAVIM1pa3qQSusfS b1lkt5CPYgVIflmGQN4eYsTO7kYmI2sz4exniEL1jCA2phuMRLXbluFwAhdVjoezZxJk=; Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by depesz.com with esmtpa (Exim 4.92) (envelope-from ) id 1lzxb5-00061B-76; Sun, 04 Jul 2021 10:35:27 +0200 Date: Sun, 4 Jul 2021 10:35:27 +0200 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: "Dean Gibson (DB Administrator)" Cc: pgsql-admin@postgresql.org Subject: Re: The trap when using pg_dumpall Message-ID: <20210704083527.GA20249@depesz.com> Reply-To: depesz@depesz.com References: <24285551-fa0c-0b38-5380-a58aca27a8a9@mailpen.com> <13043c13-e8ec-bc93-7a50-0da4a15b1431@mailpen.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <13043c13-e8ec-bc93-7a50-0da4a15b1431@mailpen.com> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, Jul 03, 2021 at 11:04:26PM -0700, Dean Gibson (DB Administrator) wrote: > Well, I never store the output of pg_dumpall directly; I pipe it through > gzip, & the resultant size differs by about 1% from the size from pg_dump in > custom-archive format. > > I also found that pg_dumpall -g doesn't get the triggers; pg_dumpall -s > does.  I don't know if pg-dump gets the triggers. Triggers are inside database, so normal pg_dump handles them. Generally, I stand firmly in position that one should never use pg_dumpall. Size of dump is one thing, but inability to sanely filter what you will load is deal breaker. Plus - with modern pg_dump and -Fd, both dumping time, and loading time can be significantly reduced thanks to parallelism. Wrote about it: https://www.depesz.com/2019/12/10/how-to-effectively-dump-postgresql-databases/ depesz