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 1iKnZR-0001Aj-Ab for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Oct 2019 17:58:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iKnZP-0003FX-V0 for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Oct 2019 17:58:47 +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 1iKnZP-0003FI-Hn for pgsql-hackers@lists.postgresql.org; Wed, 16 Oct 2019 17:58:47 +0000 Received: from mail-il1-x143.google.com ([2607:f8b0:4864:20::143]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iKnZM-0003GV-CK for pgsql-hackers@lists.postgresql.org; Wed, 16 Oct 2019 17:58:47 +0000 Received: by mail-il1-x143.google.com with SMTP id o16so3541399ilq.7 for ; Wed, 16 Oct 2019 10:58:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=nszXFG8Vhc63KeySxd+w1EkyPdJlTm2h+BkyshqEtzY=; b=NjDcnX/v4wYEF0BtkLFNqE+a4Jg570LNsnDdJnY1hlafTyqOyk+8KWqzEmQPMSATvs 9BkdjeKV7RZmgRDWqbmx5eYEcsZPjlPV/zfd4fo5663sTf9SRAI/ycPyKSkRvlhKQqU9 5LOCoxIVIK7DvZd0q2vOURuw0T5dXB5Jy0nzGI6CMD15CX45T0RPTNFiyI97nmFrYB0r BozlgUIg6JyTzteH048SSTJppZUYkQvMsyLNqkQ2uURWCeqP+0+S0U668YXzopRsx4ph VOFzUl9/pELW9RMKScoRuK9AfCjp/kp5cFd2bAsX9cF1Sj06zKbsihAMZMmxvWLSnzba pUng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=nszXFG8Vhc63KeySxd+w1EkyPdJlTm2h+BkyshqEtzY=; b=pz3JfEzG2U93qzmorDoIVj2ssqqDSlS+0qbHtnfHTdcz021CMEVhDfjc78kL0j4zkx iXCLMC8peJpxPZYThe1ux9OIgY5Qc/HpiYTkrXXJBHKEw8QwGxjnm924ZcSbyyq+HNFM +Juv8nPEOtYTxfco569yCjSxzffNgW6NWKZiESsRu/nMi3xcQFCaYFXHvLaUIPPuyFZi RyEg4lvcjeoIpgCscC8yop5tW//PC8NqxHbTFhgFWuesOFd6xaR3EtuQcudlzrLDSQsR 2ZFc5QwxjdUyGJsPy0Y7Iq820uNGFyiPUYN6qP/G2YabMcr53ZlCUkOZMjcp8Rj0YxSJ d3rw== X-Gm-Message-State: APjAAAXgV9NDTKVDR/M6clPnOK3WzAxLguvCXjf5EHIzEFyyK3m0ClNn cgeBy6t8M3nxeO/0kD92A4uZg84bkRA= X-Google-Smtp-Source: APXvYqyaLpqgjZMJNaKWNC9PCQstIN3/TeY7Tn2pce9GyuuNwr9u6CrU0BcaQw0kcts0v9/c7yd+cA== X-Received: by 2002:a92:255:: with SMTP id 82mr12631465ilc.61.1571248721881; Wed, 16 Oct 2019 10:58:41 -0700 (PDT) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id t18sm4138874ilm.51.2019.10.16.10.58.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Oct 2019 10:58:40 -0700 (PDT) Received: by pryzbyj (Postfix, from userid 1000) id A355A801065; Wed, 16 Oct 2019 12:58:38 -0500 (CDT) Date: Wed, 16 Oct 2019 12:58:38 -0500 From: Justin Pryzby To: Stephen Frost Cc: "imai.yoshikazu@fujitsu.com" , Euler Taveira , Tom Lane , Andrew Gierth , pgsql-hackers@lists.postgresql.org Subject: Re: v12 and pg_restore -f- Message-ID: <20191016175838.GL3599@telsasoft.com> References: <20191006190839.GE18030@telsasoft.com> <28770.1570394593@sss.pgh.pa.us> <875zl11tla.fsf@news-spur.riddles.org.uk> <30069.1570396524@sss.pgh.pa.us> <20191008180840.GQ6962@tamriel.snowman.net> <20191009124505.GT6962@tamriel.snowman.net> <20191016172148.GH6962@tamriel.snowman.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191016172148.GH6962@tamriel.snowman.net> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sun, Oct 06, 2019 at 04:43:13PM -0400, Tom Lane wrote: > Nobody is going to wish that to mean "write to a file named '-'", so Probably right, but it occurs to me that someone could make a named pipe called that, possibly to make "dump to stdout" work with scripts that don't support dumping to stdout, but with what's arguably a self-documenting syntax. On Wed, Oct 09, 2019 at 09:07:40AM -0300, Euler Taveira wrote: > > Maintenance scripts break across major versions. ... > Yeah, if you check pg_restore version, you could use new syntax for > 12+. We break scripts every release (mainly with catalog changes) and > I don't know why this change is different than the other ones. The > pg_restore changes is more user-friendly and less error-prone. The issue isn't that scripts broke, but that after I fixed scripts to work with v12, it's impossible (within pg_restore and without relying on shell or linux conventions) to write something that works on both v11 and v12, without conditionalizing on pg_restore --version. On Wed, Oct 16, 2019 at 01:21:48PM -0400, Stephen Frost wrote: > [...] if they actually need to work with both concurrently (which strikes me > as already at least relatively uncommon...). I doubt it's uncommon. In our case, we have customers running centos6 and 7. There's no postgis RPMs provided for centos6 which allow an upgrade path to v12, so we'll end up supporting at least (centos6, pg11) and (centos7,pg12) for months, at least. I have a half dozen maintenance scripts to do things like reindex, vacuum, cluster, alter tblspace. In the immediate case, our backup script runs pg_restore to check if an existing pg_dump backup of an old table is empty when the table is not itself empty - which has happened before due to logic errors and mishandled DST... (We're taking advantage of timeseries partitioning so daily backups exclude tables older than a certain thershold, which are assumed to be unchanged, or at least not have data updated). I'd *like* to be able to deploy our most recent maint scripts during the interval of time our customers are running different major versions. The alternative being to try to remember to avoid deploying updated v12 scripts at customers still running v11. I went to the effort to make our vacuum/analyze script support both versions following the OID change. I worked around the pg_restore change using /dev/stdout ; possibly the documentation should mention that workaround for portability to earlier versions: that would work for maybe 85% of cases. If need be, one could check pg_restore --version. But it's nicer not to need to. Tom's proposed in February to backpatch the -f- behavior, so ISTM that we're right now exactly where we (or at least he) planned to be, except that the backpatch ideally should've been included in the minor releases in August, before v12 was released. https://www.postgresql.org/message-id/24868.1550106683%40sss.pgh.pa.us Justin