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 1hF6mr-0006ZZ-JN for pgsql-admin@arkaria.postgresql.org; Sat, 13 Apr 2019 00:44:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hF6mo-0002vR-F5 for pgsql-admin@arkaria.postgresql.org; Sat, 13 Apr 2019 00:44:50 +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 1hF6mo-0002uI-3s for pgsql-admin@lists.postgresql.org; Sat, 13 Apr 2019 00:44:50 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hF6ml-0004uk-Ro for pgsql-admin@lists.postgresql.org; Sat, 13 Apr 2019 00:44:49 +0000 Received: by mail-pf1-x442.google.com with SMTP id w25so5879841pfi.9 for ; Fri, 12 Apr 2019 17:44:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=cL6u9KwVk0kRtxFhh3NzFLA/LrwMUjAzpl6GChWJzec=; b=gmabGzSbm4dy/h3Wh2ojScwPVt0Q1oPu7nOoKWM9gR/pDfKNRbMV9sefDzn0wYVHmY xCANonKQ7POezuPdFRfYHJulGovkjC4XG+01yYQjHr2QczGA7SrTtCJMitShEE3McLm6 i0S7fPOhfDkep0YJ+5u6f+8+d/G2lu5fTTItXPA0dMdz2Pq38dsU46XCzOGyR1xLdHnE oI4SAvNrk+feAP9Var+0RTWtU4N6Mj0yAxzfftaTRUVcvaojTdQG2DhNFQtXZ+eB3A6X 6NKmILLI2MIDOc4TzQQLAkemitVRots0AC01mGiiPcPshqYPgVWGZm6lFVMcX73zvckC zdAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=cL6u9KwVk0kRtxFhh3NzFLA/LrwMUjAzpl6GChWJzec=; b=XcCDlO7df+C+44wR7TBUfEiqQ8uByG+HnUkqMCbdw4YjfIKu1SCjx9QqIEpO6CMZfG JalljrfS618KMQNf90Nr0lQsmZp3ibdDvFUta3EEyeQ0fEU+uZo2a9Y5ljTGNX+gWi4l YLh8tAOatXmsFIUrjVdLAmits5+d00JirSSCVJ3bjs4zUJaUU5XQvSxauAE7pNxKA9Ns MMTwTVKQFZHWjzKoqe4YLpJ4z+/Ga5Cxe5QVgGF610ZukJWbSjU7vCce8S2mF1fzg1fr +DfuGStiwr7xUvcy/rh3Yb6GTZpZS8sjiSLi703PH3tw6+Ft1QVvA8Qpjx5KrqXNXDT8 7UQg== X-Gm-Message-State: APjAAAW+5AqQuwR+SsytkwJ/8HSdJcDlgAjpmjII/TRT821kooAozTfS z9Zi98wDVCZ8yJxPcC8vZ3A= X-Google-Smtp-Source: APXvYqxYs8kCDOD8g6G1TVVZufeltXYvhPzHm0Rp/t0rrdXYJPiwxmfqPQerSbAeuJ0NaImWJxhjJA== X-Received: by 2002:a62:fb0a:: with SMTP id x10mr60723469pfm.179.1555116283449; Fri, 12 Apr 2019 17:44:43 -0700 (PDT) Received: from tim-desktop (2001-44b8-31f2-bb00-a5d6-05ce-029c-d3e1.static.ipv6.internode.on.net. [2001:44b8:31f2:bb00:a5d6:5ce:29c:d3e1]) by smtp.gmail.com with ESMTPSA id l19sm10990287pfi.87.2019.04.12.17.44.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 12 Apr 2019 17:44:42 -0700 (PDT) References: <93bf4376-6167-a89f-83c5-36aa0dadae2e@gmail.com> User-agent: mu4e 1.1.0; emacs 26.1 From: Tim Cross To: pgsql-admin@lists.postgresql.org Cc: pgsql-admin Subject: Re: pg_dump using anything other than custom and directory In-reply-to: <93bf4376-6167-a89f-83c5-36aa0dadae2e@gmail.com> Date: Sat, 13 Apr 2019 10:44:38 +1000 Message-ID: <87ef66vimh.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I use the plan format quite often for data migration tasks. For example, I can run the dump through sed and change all references to a database/table/column/etc or modify data, such as replacing email addresses with test addresses. I've used this technique to have scripts which I can use to refresh development or uat environments from production systems when other alternatives, like file system snapshots are not available or we need to modify the data. A similar technique can be used to mask/change sensitive data, though there are probably better tools for doing that. The tar format can be quite useful, particularly when you use it in a data processing 'pipeline' i.e. data > tar > process (possibly with network channels) > tar > new data Having the ability to dump out the data in a form which can be manipulated by other tools is extremely useful. Sometimes you need/want to do something which simply has not been catered for using the other tools - having a plain text dump provides that flexibility. Yes, they can be large and for Tb size DBs are probably impracticable, but there are a lot of important or business critical DBs which are quite small in size (it isn't the size of the database, but how you use it!). You can also avoid version compatibility issues. We had one of these recently. An external developer wanted a recent dump of a database to work on locally. His local PG versions were quite old and he didn't want to update/upgrade. When trying to use pg_restore, he got a header version mismatch error and could not import the data. A gzipped plain dump of the database was not much larger than the custom dump and he was able to run it in psql with no problems. (yes, he should upgrade/update his PG install, but that is a different battle and not one to have at a mission critical time). Tim Ron writes: > Hi, > > In 2019 using supported versions of PostgreSQL, what practical use is there to > use the tar format, and -- other than migrating trivially sized databases to > other RDBMSs -- the plain format? > > Thanks -- Tim Cross