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 1ggALe-0007Mk-3e for pgsql-hackers@arkaria.postgresql.org; Sun, 06 Jan 2019 15:28: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 1ggALa-0007iP-Vc for pgsql-hackers@arkaria.postgresql.org; Sun, 06 Jan 2019 15:28:18 +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 1ggALa-0007i0-NT for pgsql-hackers@lists.postgresql.org; Sun, 06 Jan 2019 15:28:18 +0000 Received: from ssl.nataraj.su ([195.54.209.170]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ggALY-00006L-Dg for pgsql-hackers@postgresql.org; Sun, 06 Jan 2019 15:28:18 +0000 Received: from x200m.localnet (unknown [91.108.35.130]) by ssl.nataraj.su (Postfix) with ESMTPSA id 4D173511E019; Sun, 6 Jan 2019 18:28:15 +0300 (MSK) From: Nikolay Shaplov To: pgsql-hackers@lists.postgresql.org Cc: Alvaro Herrera , Tom Lane , Robert Haas , Nikita Glukhov , "pgsql-hackers@postgresql.org" Subject: Re: [PATCH][PROPOSAL] Add enum releation option type Date: Sun, 06 Jan 2019 18:28:11 +0300 Message-ID: <1777585.CqHLqLDU7p@x200m> User-Agent: KMail/5.2.3 (Linux/4.9.0-8-amd64; KDE/5.28.0; x86_64; ; ) In-Reply-To: <201901032112.xpqqwmumqml2@alvherre.pgsql> References: <201901032112.xpqqwmumqml2@alvherre.pgsql> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk =D0=92 =D0=BF=D0=B8=D1=81=D1=8C=D0=BC=D0=B5 =D0=BE=D1=82 =D1=87=D0=B5=D1=82= =D0=B2=D0=B5=D1=80=D0=B3, 3 =D1=8F=D0=BD=D0=B2=D0=B0=D1=80=D1=8F 2019 =D0= =B3. 18:12:05 MSK =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0= =B5=D0=BB=D1=8C Alvaro Herrera=20 =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB: > Attached version 7, with some renaming and rewording of comments. > (I also pgindented. Some things are not pretty because of lack of > typedefs.list patching ... a minor issue at worst.) Thanks! Imported it into my code tree.. > I'm still not satisfied with the way the builtin enum tables are passed. > Can we settle for using add_enum_reloption instead at initialization > time? Maybe that would be less ugly. Alternatively, we can have > another member in relopt_enum which is a function pointer that returns > the array of relopt_enum_elt_def. Not sure at which point to call that > function, though. Actually I am not satisfied with it too... That is why I started that bigge= r=20 reloptions refactoring work. So for now I would offer to keep initializatio= n=20 as it was for other types: in initialize_reloptions using [type]RelOpts[]= =20 arrays. And then I will offer patch that changes it for all types and remov= e=20 difference between biult-in reloptions and reloptions in extensions. > I think it would be great to have a new enum option in, say, > contrib/bloom, to make sure the add_enum_reloption stuff works > correctly. If there's nothing obvious to add there, let's add something > to src/test/modules. As far as I can see there is no obvious place in bloom where we can add enu= m=20 options. So I see several options here: 1. I can try to create some dummy index in src/test/modules. And it would = be=20 very useful for many other tests. For example we will have no real string=20 reloption when this patch is applied. But it may take a reasonable time to = do,=20 because I've never created indexes before, and I do not have many time-slot= s=20 for postgres development in my schedule. 2. Actually I am going to offer patch that will remove difference between=20 build-in and extension reloptions, all reloptions will use same API. After= =20 applying that patch we would not need to test add_[type]_reloption calls=20 separately. So may be it would be good enough to check that add_enum_relopt= ion=20 works right now (add an enum option to bloom, check that it works, and do n= ot=20 commit that code anywhere) and then wait until we get rid of=20 add_[type]_reloption API.=20 This will save us some time. I am a bit worrying about Nikita Glukhov patch= it=20 is better to have reloptions reworked before adding opclass options. 2.5 May be this src/test/modules dummy index is subject to another patch. = So=20 I will start working on it right now, but we will do this work not dependen= t=20 to any other patches. And just add there what we need when it is ready. I=20 would actually add there some code that checks all types of options, becaus= e=20 we actually never check that option value from reloptons successfully reach= es=20 extension code. I did this checks manually, when I wrote that bigger relopt= ion=20 patch, but there is no facilities to do regularly check is via test suit.=20 Creating dummy index will create such facilities.=20 =46or me all options are good enough, so it is for you too choose, I will d= o as=20 you advices.