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 1gmLr4-000702-BA for pgsql-hackers@arkaria.postgresql.org; Wed, 23 Jan 2019 16:58:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gmLr2-0004RM-OK for pgsql-hackers@arkaria.postgresql.org; Wed, 23 Jan 2019 16:58:20 +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 1gmLr2-0004Qk-CF for pgsql-hackers@lists.postgresql.org; Wed, 23 Jan 2019 16:58:20 +0000 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gmLqv-0000cB-36 for pgsql-hackers@postgresql.org; Wed, 23 Jan 2019 16:58:19 +0000 Received: by mail-qt1-x841.google.com with SMTP id d19so3120692qtq.9 for ; Wed, 23 Jan 2019 08:58:12 -0800 (PST) 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=PprmCFOFOx9WALHJXqdsWgiisaMDOdJw4b9tTqzohss=; b=qNt0uOSYy2A5knxhbBZ9vEDq2hTOLDkjIkZsayKuHCA016UDDTozksx25wq3YunesZ 3DxodGIhB1eRhhZW5JCpqd35dqWy0eIiw20QAeTPjUxtfHhg41rdujNPvt8Mqe619FbA 1pEV9AOgkr00a3e82mb3vvCvZtsUhUU2Cn58jKDjEcpl6WS9CXl4KPegI3lGzqniF3MR Cj6PB9YjM65cFR97bnOiqtG/ULDHOYJBQ0cpVyaKZcKNw7wo14VIWLrqdw5jTvZeM4Ky XoVIr3AIsQ5As4FbAluaCEWFVHGxWDPPFvizJ62Wzme2SPcFw1UmusVlyneO4t9wbPtK qFbA== 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=PprmCFOFOx9WALHJXqdsWgiisaMDOdJw4b9tTqzohss=; b=InIVCck2Mpsg+vMffxNnkWNleRPEKMfBxaTZyoX7Vl+cTaoOPdxZVeSap3FrALF6Tc TYtOcKxxEhxH+COUBjGMn+JA48iZ5YjuJsWRHqVR6j/6GiiECP5H8HdpD8lj6oxb/kBs 0b92kvdwqlVZvaLxPfrUYYAzQIL4lTII24uTS+QC58iHbJDf1oVwIHMoaI55Hfb1iqbq A3uFg4lKRwWqjS1Z7Qzx2xqne0arJHFgSfphFhKzFhGOe3pSWYMXzHvduAa+8jFcqlTj dYb9n8Ky7EllKEWzPilwf9fKSHadf+gMOXKWE3lI03XgwsPTlzQmOR+2MD033qZxUwQm OiUw== X-Gm-Message-State: AJcUukehGNvbNlFHXd5F/oZF1lPzvYHiKXFecDlOpKXlkCgTLmKPc4U6 A3Gx0Oqc/SN8zyIScKfCxJLuAQ== X-Google-Smtp-Source: ALg8bN4dCtEhShodhv/RmIxYTpkTcpwpfmt3AWxlfAcGDoBK9aV/Xnm2Vmr3u0Req4ESRzfRqQ1Njw== X-Received: by 2002:aed:3263:: with SMTP id y90mr3019992qtd.269.1548262690260; Wed, 23 Jan 2019 08:58:10 -0800 (PST) Received: from alvin.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id v22sm64457338qkl.27.2019.01.23.08.58.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Jan 2019 08:58:09 -0800 (PST) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 8036FA74; Wed, 23 Jan 2019 13:58:07 -0300 (-03) Date: Wed, 23 Jan 2019 13:58:07 -0300 From: Alvaro Herrera To: Andres Freund Cc: Dmitry Dolgov <9erthalion6@gmail.com>, Tom Lane , Amit Khandekar , PostgreSQL-development Subject: Re: ArchiveEntry optional arguments refactoring Message-ID: <201901231658.fls2whf2xypv@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190123164734.cnt7ho34ygwsav7z@alap3.anarazel.de> User-Agent: NeoMutt/20180716-1013-2c1e88 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello On 2019-Jan-23, Andres Freund wrote: > > All the arguments, except Archive, CatalogId and DumpId I've moved > > into the ArchiveOpts structure. Not all of them could be empty before, but > > anyway it seems better for consistency and readability. Some of the arguments > > had empty string as a default value, I haven't changed anything here yet > > (although this mixture of NULL and "" in ArchiveEntry looks a bit confusing). > > Probably worth changing at the same time, if we decide to go for it. > > To me this does look like it'd be more maintainable going forward. It does. How does pgindent behave with it? I'd use ArchiveEntryOpts as struct name; ArchiveOpts sounds wrong. Also, the struct members could use better names -- "defn" for example could perhaps be "createStmt" (to match dropStmt/copyStmt), and expand "desc" to "description". -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services