Re: [PATCH] Add some useful asserts into View Options macroses - Mailing list pgsql-hackers

From Nikolay Shaplov
Subject Re: [PATCH] Add some useful asserts into View Options macroses
Date
Msg-id 4501528.Pae3bDk7cQ@x200m
Whole thread Raw
In response to Re: [PATCH] Add some useful asserts into View Options macroses  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: [PATCH] Add some useful asserts into View Options macroses
List pgsql-hackers
В письме от понедельник, 7 октября 2019 г. 12:59:27 MSK пользователь Robert
Haas написал:

> > 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.
> >
> > I've decided to split that patch into smaller parts.
> >
> > 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 asserts
> > 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 current
master code, fillfactor from StdRdOptions is used in Toast, Heap, Hash index,
nbtree index, and spgist index. This will make RelationGetFillFactor macros a
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
for it, it will not make the code too complex.

So I would suggest to do ViewOptions asserts now, and keep dealing with
StdRdOptions for later. When we are finished with my current patches, I will
take care about it.

--
Software Developer: https://www.upwork.com/freelancers/~014a87e140ff02c0da
Body-oriented Therapist: https://vk.com/nataraj_rebalancing  (Russian)



pgsql-hackers by date:

Previous
From: Antonin Houska
Date:
Subject: Re: Transparent Data Encryption (TDE) and encrypted files
Next
From: Nikolay Shaplov
Date:
Subject: Re: [PATCH] use separate PartitionedRelOptions structure to store partitioned table options