Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1covZl-00031c-Jf for pgsql-hackers@arkaria.postgresql.org; Fri, 17 Mar 2017 17:22:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1covZl-0007e5-6S for pgsql-hackers@arkaria.postgresql.org; Fri, 17 Mar 2017 17:22:05 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1covZj-0007c7-Kz for pgsql-hackers@postgresql.org; Fri, 17 Mar 2017 17:22:03 +0000 Received: from mail-qk0-x22e.google.com ([2607:f8b0:400d:c09::22e]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1covZh-00016v-0P for pgsql-hackers@postgresql.org; Fri, 17 Mar 2017 17:22:02 +0000 Received: by mail-qk0-x22e.google.com with SMTP id p64so69931939qke.1 for ; Fri, 17 Mar 2017 10:22:00 -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=f9Sb6jkM3X6sY/KHSbEKve1Q446MSo7hCOxepXQCNCQ=; b=BbwzXGMkSD0I/M7saZ2xbLm8XgvBwjEa/QYGqsd277kyQ+CDl/DC2C3tYVBS/91/qw KU2UwsB3Qhj1O0mm8ILxeVUV4f4mDKvFF3gb0cmmopZMvFQof2kQyQYcdFhfPJqOanUK 53Ym/ktCMyODfMXuY4MPtt3jPqO8Kjwsmu/MMlzjiESThe2qw714MK2+Nfa9ZzxEoZFz s4VEbxTBRXAJM9/ThOmhvyVI3ElUowdHHWOONQ8+v4ZknU/zgzzmoHTopMm6JRqyNXAy 9XGZDLP325rC+qwYcTBe/SLORH0HpBxajOrbSZZ/FK+1Pwy8ZPwn/s6LIcTZTccqXAm9 oj5g== 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=f9Sb6jkM3X6sY/KHSbEKve1Q446MSo7hCOxepXQCNCQ=; b=oDlCA5ZjUjLrbsgTJue4x50WSQmivMmqaGn2/+/Kn53vTphQf+6tbad5Bo+lMbZ6Zl 7oWswo+cvKYS4buqb85ITdp2KHSdconnR9vosTMkZ1Oz5whI2GzT5lGlpDa4la9iG1Ol rYz+arxEaYVpZHgeo558LEMldm6lMY/BN8ZBhPOAZ6mTcUCiBoVzD3VM/80WD2NRBWFj SjhamlRaGL1Ft4b4byyKu8nI+3nOo5PpMYtldyGOmTkmsmc9B0yPFt/l1aDW/H0tCv3q SHKtUG3Z5Tbb4Gx5TjNePACZOJ8WBDHcV+V3RDYk4mo9q1Qf3noyfYmp1xtpiKdoT2SC kIEA== X-Gm-Message-State: AFeK/H1fIHGaD/ORSDZP2xsb0iUXKK8mIN5bwh9kTE7r35mTtn9teXKKumg8psvoXGqSREKI X-Received: by 10.233.223.130 with SMTP id t124mr13786094qkf.153.1489771319665; Fri, 17 Mar 2017 10:21:59 -0700 (PDT) Received: from alvin.alvh.no-ip.org ([179.57.115.10]) by smtp.gmail.com with ESMTPSA id j35sm6318731qtc.63.2017.03.17.10.21.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Mar 2017 10:21:59 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id E19EEF75; Fri, 17 Mar 2017 14:21:26 -0300 (CLST) Date: Fri, 17 Mar 2017 14:21:26 -0300 From: Alvaro Herrera To: Nikolay Shaplov Cc: pgsql-hackers@postgresql.org Subject: Re: [PATCH] Move all am-related reloption code into src/backend/access/[am-name] and get rid of relopt_kind for custom AM Message-ID: <20170317172126.o452q2cjds6o3pfx@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3123308.RiobK7ytJP@x200m> User-Agent: NeoMutt/20170206-195-7adf12 (1.7.2) X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org I gave this patch a quick skim. At first I was confused by the term "catalog"; I thought it meant we stored options in a system table. But that's not what is meant at all; instead, what we do is build these "catalogs" in memory. Maybe a different term could have been used, but I'm not sure it's stricly necessary. I wouldn't really bother. I'm confused by the "no ALTER, no lock" rule. Does it mean that if "ALTER..SET" is forbidden? Because I noticed that brin's pages_per_range is marked as such, but we do allow that option to change with ALTER..SET, so there's at least one bug there, and I would be surprised if there aren't any others. Please make sure to mark functions as static (e.g. bringetreloptcatalog). Why not pass ->struct_size and ->postprocess_fun (which I'd rename it as ->postprocess_fn, more in line with our naming style) as a parameter to allocateOptionsCatalog? Also, to avoid repalloc() in most cases (and to avoid pallocing more options that you're going to need in a bunch of cases, perhaps that function should the number of times you expect to call AddItems for that catalog (since you do it immediately afterwards in all cases I can see), and allocate that number. If later another item arrives, then repalloc using the same code you already have in AddItems(). Something is wrong with leading whitespace in many places; either you added too many tabs, or the wrong number spaces; not sure which but visually it's clearly wrong. ... Actually there are whitespace-style violations in several places; please fix using pgindent (after adding any new typedefs your defining to typedefs.list). -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers