Re: [BUG] hstore integer overflow when constructing large values

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Tender Wang <tndrwang(at)gmail(dot)com>
Cc: Keyerror Smart <smartkeyerror(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [BUG] hstore integer overflow when constructing large values
Date: 2026-08-17 04:05:22
Message-ID: aoKIgkA6gxxjgKa8@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 17, 2026 at 11:06:17AM +0800, Tender Wang wrote:
> Given that the rest of the patch is moving allocation-size arithmetic to
> `Size` and `add_size()`/`mul_size()`, I wonder if this should use
> `add_size()` as well.
>
> Perhaps the existing size limits make an overflow there unreachable in
> practice, but using `add_size()` would seem more consistent with the rest
> of this patch.

I was wondering about this part as well, but discarded it as not
reachable in practice. So it should not matter at the end.

The nested calls in hstore_out() feel a bit inelegant as well written
this way. Something in sequential form would feel much easier to
parse, with one line for each add_size involved.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bertrand Drouvot 2026-08-17 04:43:07 Re: pgstat: Flush some statistics within running transactions, take 2
Previous Message shveta malik 2026-08-17 04:02:41 Re: Support EXCEPT for TABLES IN SCHEMA publications