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.92) (envelope-from ) id 1jCQ6R-0001ks-Fv for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Mar 2020 15:50:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jCQ6O-00043t-Ds for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Mar 2020 15:50:28 +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 1jCQ6O-00043m-4h for pgsql-hackers@lists.postgresql.org; Thu, 12 Mar 2020 15:50:28 +0000 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jCQ6K-0007wU-UP for pgsql-hackers@postgresql.org; Thu, 12 Mar 2020 15:50:27 +0000 Received: by mail-qt1-x842.google.com with SMTP id v15so4746055qto.2 for ; Thu, 12 Mar 2020 08:50:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=uB/g7y+/IN/mtfK3nLKqcxlB23eIhNDVepTRtSOHyFk=; b=GOE3aTEQp6WoC/B+4FXGA7B2TUgvI2kp80bPJ4cUaktrVEmmzReNxTGRBmUXegRBMU L9/HNwURl4ae5rHdxSfBrUdWjk8iWEbR3wHzZFbmYJ8y7AtaxiQu1SoRxhmFTvAq1Uul RcupEJe8yYhnxMnjSnrUKj7j1gXlzRfEuh6cJUuL7Om3q5DIR5AyWVVWLWGRVF9u8B1Q u2HjisMgXfHU4ajMSRqwhMRwUHcHfvS5jak6XiZj1X52cRyF9OGyiWQtrg0LO8JGFZPe xK//BNDDOIL9qp0wJST5FZMiIodCrs1iwGHg896T/ByzKzaOzQhLL2osMaC9zwWlMw0w xlgg== 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:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=uB/g7y+/IN/mtfK3nLKqcxlB23eIhNDVepTRtSOHyFk=; b=RdfygucVT7WMv5D/15vUiKjopWAZJq5TuOqUwmu9w0OuHJlHw7vQIZhD2Gp5RTEcnG 9IC2+2Qfd4nLWWVGzGW1oA0adV4fdUrNEO9Ws1n8p3rzdhJZeZSiB5SMMy0g56b3qf6j YH+QXnKtnW/Q/+vtiXKk8oBpGlhQn3CqcpsRLify/XZAGZXeTpUWPyCC93wmz7yWtS11 LMZmJMM+eLYE57/tSL689EzshPZzlHhh5DGq/9JwcWerrxoFv6/gUKC80cNHh0GQmDvj KRbJ3BySnexPFZk+BKpYncUfVKua3RyWzXBS2Skqf6GdWeM3o+MKHgSyE9TUoWgL+vcU YgKw== X-Gm-Message-State: ANhLgQ1OpaDtwmc2jhiyxKs+vX4Kg1QnmsD8Wn35m58I3LP1Ijx45/Rd F85jhxCeIba9UJH7y6wOWeznTg== X-Google-Smtp-Source: ADFU+vtESzDJK+BHEs83JVrD/qk/yeROKe1yu2WxyElK/boqb85qce0ieW0LjvWXTG94v4rz9Z2Hag== X-Received: by 2002:ac8:b42:: with SMTP id m2mr8017189qti.67.1584028221534; Thu, 12 Mar 2020 08:50:21 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.121.31.1]) by smtp.gmail.com with ESMTPSA id 11sm28155421qkr.101.2020.03.12.08.50.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2020 08:50:20 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id D1AC6300AB8; Thu, 12 Mar 2020 12:50:17 -0300 (-03) Date: Thu, 12 Mar 2020 12:50:17 -0300 From: Alvaro Herrera To: Michael Paquier Cc: Alexander Korotkov , Kuntal Ghosh , Alexey Kondratov , Liudmila Mantrova , Thomas Munro , Andrey Borodin , David Steele , Andres Freund , PostgreSQL-development , Dmitry Dolgov <9erthalion6@gmail.com>, vladimirlesk@yandex-team.ru, dsarafan@yandex-team.ru Subject: Re: [Patch] pg_rewind: options to use restore_command from recovery.conf or command line Message-ID: <20200312155017.GA12284@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200311032620.GB3099@paquier.xyz> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Mar-11, Michael Paquier wrote: > On Tue, Mar 10, 2020 at 12:39:53PM -0300, Alvaro Herrera wrote: > > Another option is to return the command as a palloc'ed string (per > > psprintf), instead of using a caller-stack-allocated variable. Passing > > the buffer len is widely used, but more error prone (and I think getting > > this one wrong might be more catastrophic than a mistake elsewhere.) > > This is not a performance-critical path enough that we *need* the > > optimization that avoids the palloc is important. (Failure can be > > reported by returning NULL.) > > That's a better approach here. Thanks, looks good. I don't think we *need* the MAXPGPATH restriction really -- I was thinking in a StringInfo kind of approach where you just append the stuff you need without having to think about the buffer length. > > Also, I think Msvcbuild.pm could follow Makefile's ideas of one line per > > file. Maybe no need to fix all of that in this patch, but let's start > > by adding the new file it its own line rather than reflowing two > > adjacent lines (oh wait ... does perltidy put it that way? if so, > > nevermind.) > > Good idea. It happens that perltidy does not care about that, but I > would rather keep that stuff for a separate patch/thread. Aha, good. I would still put the new "archive.c" entry on its own line, and just keep the other two lines unchanged. (That preserves the perhaps non-obvious property that all entries that start with the same letter are in the same line.) -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services