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 1iHmyn-0005ws-MF for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Oct 2019 10:44:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iHmyk-0008GS-T1 for pgsql-hackers@arkaria.postgresql.org; Tue, 08 Oct 2019 10:44:30 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iHmyk-0008GA-H0 for pgsql-hackers@lists.postgresql.org; Tue, 08 Oct 2019 10:44:30 +0000 Received: from ssl.nataraj.su ([195.54.209.170]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1iHmyh-0007ig-SF for pgsql-hackers@lists.postgresql.org; Tue, 08 Oct 2019 10:44:29 +0000 Received: from x200m.localnet (unknown [176.59.4.34]) by ssl.nataraj.su (Postfix) with ESMTPSA id 87814511E071; Tue, 8 Oct 2019 13:44:26 +0300 (MSK) From: Nikolay Shaplov To: Robert Haas Cc: Michael Paquier , Tomas Vondra , PostgreSQL Hackers , Dent John , "Iwata, Aya" , Alvaro Herrera , Dmitry Dolgov <9erthalion6@gmail.com>, Thomas Munro Subject: Re: [PATCH] Add some useful asserts into View Options macroses Date: Tue, 08 Oct 2019 13:44:25 +0300 Message-ID: <4501528.Pae3bDk7cQ@x200m> User-Agent: KMail/5.2.3 (Linux/4.9.0-8-amd64; KDE/5.28.0; x86_64; ; ) In-Reply-To: References: <3634983.eHpMQ1mJnI@x200m> 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 =D0=BF=D0=BE=D0=BD= =D0=B5=D0=B4=D0=B5=D0=BB=D1=8C=D0=BD=D0=B8=D0=BA, 7 =D0=BE=D0=BA=D1=82=D1= =8F=D0=B1=D1=80=D1=8F 2019 =D0=B3. 12:59:27 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 Robert=20 Haas =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB: > > This thread is a follow up to the thread > > https://www.postgresql.org/message-id/2620882.s52SJui4ql@x200m where I'= ve > > been trying to remove StdRdOptions structure and replace it with unique > > structure for each relation kind. > >=20 > > I've decided to split that patch into smaller parts. > >=20 > > This part adds some asserts to ViewOptions macroses. > > Since an option pointer there is converted into (ViewOptions *) it would > > be > > really good to make sure that this macros is called in proper context, = and > > we do the convertation properly. At least when running tests with asser= ts > > turned on. > Seems like a good idea. Should we try to do something similar for the > macros in that header file that cast to StdRdOptions? That would not be as easy as for ViewOptions. For example as for the curren= t=20 master code, fillfactor from StdRdOptions is used in Toast, Heap, Hash inde= x,=20 nbtree index, and spgist index. This will make RelationGetFillFactor macros= a=20 bit complicated for example. Now I have patches that limits usage of StdRdOptions to Heap and Toast. When StdRdOptions is not that widely used, we whould be able to add asserts= =20 for it, it will not make the code too complex. So I would suggest to do ViewOptions asserts now, and keep dealing with=20 StdRdOptions for later. When we are finished with my current patches, I wil= l=20 take care about it. =2D-=20 Software Developer: https://www.upwork.com/freelancers/~014a87e140ff02c0da Body-oriented Therapist: https://vk.com/nataraj_rebalancing (Russian)