Re: Adding REPACK [concurrently] - Mailing list pgsql-hackers

From Antonin Houska
Subject Re: Adding REPACK [concurrently]
Date
Msg-id 5807.1775717940@localhost
Whole thread Raw
In response to Re: Adding REPACK [concurrently]  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Antonin Houska <ah@cybertec.at> writes:

> > We already introduced this definition above in the function to suppress this
> > kind of warning
>
> >     union
> >     {
> >         alignas(int32) varlena hdr;
> >         char        data[sizeof(void *)];
> >     }            chunk_header;
>
> > The problem on a 32-bit system probably is that sizeof(void *) is 4. We need
> > some other constant. Maybe (sizeof(varlena) + 1) ...
>
> This seems unnecessarily Rube Goldberg-ish already.

Indeed.

> Why not just
>
>     uint64    chunk_header;
>
> It will not hurt anything if the variable has more-than-required
> alignment.  And it'd be better if it were the same size everywhere.

That's certainly better. Thanks.

--
Antonin Houska
Web: https://www.cybertec-postgresql.com



pgsql-hackers by date:

Previous
From: Lakshmi N
Date:
Subject: Re: DOCS: pg_plan_advice minor doc fixes
Next
From: Xuneng Zhou
Date:
Subject: Re: Bug: WAIT FOR LSN crashes with assertion failure inside PL/pgSQL DO blocks and procedures