Re: logrep stuck with 'ERROR: int2vector has too many elements' - Mailing list pgsql-hackers

From Tom Lane
Subject Re: logrep stuck with 'ERROR: int2vector has too many elements'
Date
Msg-id 1692126.1673815989@sss.pgh.pa.us
Whole thread Raw
In response to Re: logrep stuck with 'ERROR: int2vector has too many elements'  (Andres Freund <andres@anarazel.de>)
Responses Re: logrep stuck with 'ERROR: int2vector has too many elements'
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> For the purpose here a limit of MaxTupleAttributeNumber or such instead of
> FUNC_MAX_ARGS would do the trick, I think?

As long as we have to change the code, we might as well remove the
arbitrary restriction.

> Should this be repalloc0? I don't know if the palloc0 above was just used with
> the goal of initializing the "header" fields, or also to avoid trailing
> uninitialized bytes?

I think probably the palloc0 was mostly about belt-and-suspenders
programming.  But yeah, its only real value is to ensure that all
the header fields are zero, so I don't think we need repalloc0
when enlarging.  After we set the array size at the end of the
loop, it'd be a programming bug to touch any bytes beyond that.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: logrep stuck with 'ERROR: int2vector has too many elements'
Next
From: Andres Freund
Date:
Subject: Re: logrep stuck with 'ERROR: int2vector has too many elements'