Re: [PATCH][PROPOSAL] Add enum releation option type - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: [PATCH][PROPOSAL] Add enum releation option type
Date
Msg-id 20190701180628.GA17184@alvherre.pgsql
Whole thread Raw
In response to Re: [PATCH][PROPOSAL] Add enum releation option type  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: [PATCH][PROPOSAL] Add enum releation option type  (Nikolay Shaplov <dhyan@nataraj.su>)
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [PATCH] get rid of StdRdOptions, use individual binaryreloptions representation for each relation kind instead
Next
From: Tom Lane
Date:
Subject: Re: POC: converting Lists into arrays