Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1emLlP-0005Jq-L5 for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Feb 2018 15:47:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1emLlO-0002yO-Sy for pgsql-hackers@arkaria.postgresql.org; Thu, 15 Feb 2018 15:47:58 +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 1emLk8-0005by-Fs for pgsql-hackers@lists.postgresql.org; Thu, 15 Feb 2018 15:46:40 +0000 Received: from enot.nataraj.su ([195.54.209.170]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1emLb8-00022d-U8 for pgsql-hackers@lists.postgresql.org; Thu, 15 Feb 2018 15:37:25 +0000 Received: from x200m.localnet (unknown [91.203.190.3]) by enot.nataraj.su (Postfix) with ESMTPSA id 11DF9511E0C1; Thu, 15 Feb 2018 18:37:21 +0300 (MSK) From: Nikolay Shaplov To: pgsql-hackers@lists.postgresql.org Cc: Alvaro Herrera , pgsql-hackers@postgresql.org Subject: Re: [PATCH][PROPOSAL] Add enum releation option type Date: Thu, 15 Feb 2018 18:37:20 +0300 Message-ID: <29235994.NprrEGRed4@x200m> User-Agent: KMail/4.14.1 (Linux/3.16.0-4-amd64; KDE/4.14.2; x86_64; ; ) In-Reply-To: <20180209214529.mbz6iqji7v436xde@alvherre.pgsql> References: <20180209214529.mbz6iqji7v436xde@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart6384482.9Sq0HhH6p5"; micalg="pgp-sha256"; protocol="application/pgp-signature" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --nextPart6384482.9Sq0HhH6p5 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" =D0=92 =D0=BF=D0=B8=D1=81=D1=8C=D0=BC=D0=B5 =D0=BE=D1=82 9 =D1=84=D0=B5= =D0=B2=D1=80=D0=B0=D0=BB=D1=8F 2018 18:45:29 =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 =D0=BD=D0=B0= =D0=BF=D0=B8=D1=81=D0=B0=D0=BB: > Maybe we need some in-core user to verify the string case still works= . > A new module in src/test/modules perhaps?=20 I've looked attentively in src/test/modules... To properly test all rel= options=20 hooks for modules wee need to create an extension with some dummy index= in it.=20 This way we can properly test everything. Creating dummy index would be= fun,=20 but it a quite big deal to create it, so it will require a separate pat= ch to=20 deal with. So I suppose string reloptions is better to leave untested f= or now,=20 with a notion, that it should be done sooner or later > I don't much like the way you've represented the list of possible val= ues > for each enum. I think it'd be better to have a struct that represen= ts > everything about each value (string name and C symbol. Maybe the > numerical value too if that's needed, but is it? I suppose all code > should use the C symbol only, so why do we care about the numerical > value?). One more reason to keep numeric value, that came to my mind, is that it= seems=20 to be logical to keep enum value in postgres internals represented as C= =2Denum.=20 And C-enum is actually an int value (can be easily casted both ways). I= t is=20 not strictly necessary, but it seems to be a bit logical...=20 =2D-=20 Do code for fun. --nextPart6384482.9Sq0HhH6p5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJahakwAAoJEKc13HowK+H4ymIH/2n3YneSFXi1zgLtXZf8mVTC VYONs0pAFMPEmdkmZVBaFXHkndDrftPo0vhgBhOf5JN86fuFZflL33iTQBLeoyoL r6quiYeEdGfwNdoARHBrQ2AG28cjA6xSiFErCnjSa1D3+DiU/1eWWInTC1ixsPul GKzjtmw8o3H2o3y6MWQVZ6ooOhgJwP5j20fd8+gz0Ds3AcKLM3iqNEnMKMhFo/Iq zWrZoqn4Pk8osQC2K98ka8LV1WAcolJPgsx1lZxdgvsyfZFVo0A42R8Y+DHARyKo pmtUa41G8BqN2C4QY/cFU9934fp/jLy+HSaTLapDfbOkMZcai9s/gDQMxdLndMI= =zrQV -----END PGP SIGNATURE----- --nextPart6384482.9Sq0HhH6p5--