Re: Large writable variables - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Large writable variables
Date
Msg-id 20181016041240.hhwbip74kge6ybcm@alap3.anarazel.de
Whole thread Raw
In response to Re: Large writable variables  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Hi,

On 2018-10-15 16:45:03 -0700, Andres Freund wrote:
> I've a patch making .data variables constant, fwiw. Will post in a
> bit. Just so we don't duplicate work too much.

I pushed a few very obvious ones.

An additional fix, for the system attributes in heap.c, is attached. But
that's a bit more invasive, so I wanted to get some input.

I think all of the changes are fairly obvious and the new const
attributes just document what already had to be the case.  But to
correctly propagate the const through typedef-the-pointer-away typedefs,
I had to use the underlying type (e.g. use const NameData *n2 instad of
Name n2). To me that's the correct fix, but then I hate these typedefs
with a passion anyway.  An alternative fix is to add additional
typedefs like ConstName, but I don't find that particularly
advantageous.

Comments?

Arguably we should use consts more aggresively in signatures anyway, but
I think that's a separate effort.

Greetings,

Andres Freund

Attachment

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: WIP: Avoid creation of the free space map for small tables
Next
From: Ashutosh Sharma
Date:
Subject: Re: Multi-insert into a partitioned table with before insert rowtrigger causes server crash on latest HEAD