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 1hi0hH-0000CI-Ve for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Jul 2019 18:06:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hi0hG-00012C-PP for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Jul 2019 18:06:34 +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 1hi0hG-000120-GQ for pgsql-hackers@lists.postgresql.org; Mon, 01 Jul 2019 18:06:34 +0000 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hi0hD-00015s-LA for pgsql-hackers@lists.postgresql.org; Mon, 01 Jul 2019 18:06:33 +0000 Received: by mail-qk1-x741.google.com with SMTP id t8so11772866qkt.1 for ; Mon, 01 Jul 2019 11:06:31 -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=vaVi7De8txkzD6QSSvFisE2cf0z/F+6jPpZm6uroDEc=; b=tpCSmhRmkv2AglwEZmtFVD5X6OQjlOV+IMOLgNzQ4MSbgmbWPBvacYqHTRvlJ4oUK0 9sQEABQxrpBRILcY9FOiJxH/uak1cxu4ryI2QgOuvNu6kxjSzASk6kmdDGuVIZ5P6QB+ clGPJvoOligY/63OYZB9LcolXdyrSOOK/tpSX/EIs7xX6zLZd/aCFxWWV33g73eDLkcw 0uOrHts3hfQlah0hu1VEgPBY3sUrVXLorbP8XWR1ORD2wfmqzU7oLmqS/EhtNJk4j/Ar 5yEOtb8GRPyraU4h4CFE7OVnvWmoXkgAPfZaOR2CNOsAjWkpTwiP7sBCkmhqIa5q9aCt rpXA== 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=vaVi7De8txkzD6QSSvFisE2cf0z/F+6jPpZm6uroDEc=; b=kNsWD+oHZHkoWccIdVzXhYcCYyGICSSwub/+VWNQf/wr3gxgxkTqNRmVGsXiPdSTw+ 3F4Opmh9ZajsLjaSUh+R4ws6uotmwdJYTjCAl1vnoGZqc7GTP23hzev5/hxap1CyOoVd ODqi3L5vB1wL03YvGn8wiXVq+elSKWfcil6/utzGsWvghQGEK4DcPvADWxK/gvFa4cCQ rkyob6+b48tK0g89/u121jFBycXxe5nSwtzKHfpA8ma/L+wnIbwEetHUmhcGlHPDqtHU h9Yy2J8I4+cy/ZgM5sElpEj0zepI9f9Fp9Y9BKCqWGp/05jZlkz9a8XhiikZ4AurUAK7 qsJA== X-Gm-Message-State: APjAAAWj2ACL3heQGn7QxDG3GdGf14O72qZAV3BXP1Kbk5Np2RH+4uTr x82zOMC2br162ZSAKTlyxJtEug== X-Google-Smtp-Source: APXvYqz9qRZC/qyuUq7CzxsX5BJ8Ca/gq2Z/iKnRK6+rZXbarTwbGWhyzGxsggu3xyvTnyTL37CNfw== X-Received: by 2002:a05:620a:12db:: with SMTP id e27mr22052888qkl.352.1562004390106; Mon, 01 Jul 2019 11:06:30 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id x35sm6025923qta.11.2019.07.01.11.06.29 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 01 Jul 2019 11:06:29 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 15B7B120B6B; Mon, 1 Jul 2019 14:06:28 -0400 (-04) Date: Mon, 1 Jul 2019 14:06:28 -0400 From: Alvaro Herrera To: Nikolay Shaplov Cc: pgsql-hackers@lists.postgresql.org, Tom Lane , Robert Haas , Nikita Glukhov , "pgsql-hackers@postgresql.org" Subject: Re: [PATCH][PROPOSAL] Add enum releation option type Message-ID: <20190701180628.GA17184@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <201901032112.xpqqwmumqml2@alvherre.pgsql> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk It strikes me that the way to avoid sentence construction is to have each enum reloption declare a string that it uses to list the values it accepts. So for example we would have +#define GIST_OPTION_BUFFERING_ENUM_DEF { \ + { "on", GIST_OPTION_BUFFERING_ON }, \ + { "off", GIST_OPTION_BUFFERING_OFF }, \ + { "auto", GIST_OPTION_BUFFERING_AUTO }, \ + { (const char *) NULL, 0 } \ +} + + GistBufferingValidMsg = gettext_noop("Valid values are \"on\", \"off\", and \"auto\"."); I think that's the most contentious point on this patch at this point (though I may be misremembering). -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services