On 2020-Oct-28, Tom Lane wrote: > Alvaro Herrera <alvhe...@alvh.no-ip.org> writes:
> > I think if a struct is used as a function argument somewhere or arrays > > of the struct are formed, then it's certain that changing that struct's > > size is going to cause problems. > > I grasp the point about arrays, but not sure how it's a problem for > function arguments per se? Or were you thinking of functions that > take a struct as pass-by-value not pass-by-reference? Yeah, pass-by-value. As you say we don't do that with Node structs, but there are some other structs that are sometimes passed by value. It's certainly not a common problem though. > The way I've generally thought about this is that new fields added to the > end of a Node struct are only likely to be a hazard if extension code > creates new instances of that Node type. If it does, it's certainly > problematic, first because makeNode() will allocate the wrong amount of > storage (ABI issue) and second because the extension won't know it needs > to fill the new fields (API issue). Right. > As you say, we can also search to see if there seem to be any extensions > using the struct in question. I don't have a huge amount of faith in > that, because I think there are lots of proprietary/custom extensions > that aren't visible on the net. But on the other hand, the users > of such extensions probably wouldn't have much trouble rebuilding them > for a new version, if they did get bit. It's the widely distributed > extensions that might have users not capable of dealing with that. In practice, at 2ndQuadrant we've had trouble a couple of times with ABI breaks -- certain situations can become crasher bugs, to which some customers are extremely sensitive. I've added a link to your message to the wiki here: https://wiki.postgresql.org/wiki/Committing_checklist#Maintaining_ABI_compatibility_while_backpatching