Re: undersized unions - Mailing list pgsql-hackers

From Robert Haas
Subject Re: undersized unions
Date
Msg-id CA+TgmobwLf7BewSx=mb8+-VYiadvz2C4Xu4VDzCSyxwqP1Z9VQ@mail.gmail.com
Whole thread Raw
In response to Re: undersized unions  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On Mon, Feb 6, 2023 at 1:28 PM Andres Freund <andres@anarazel.de> wrote:
> Perhaps something like

Yeah, that'd work. You'd want a big ol' warning comment here:

> typedef struct NumericData
> {
>         int32           vl_len_;                /* varlena header (do not touch directly!) */
>         NumericBase data;
> } NumericData;

like /* actually NumericShort or NumericLong */ or something

> Although I'd actually be tempted to rip out all the casts but NUMERIC_LONG()
> in this case, because it's all all just accessing the base n_header anyway.

Yeah.

-- 
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: lockup in parallel hash join on dikkop (freebsd 14.0-current)
Next
From: Robert Haas
Date:
Subject: Re: Non-superuser subscription owners