Re: Use T_IntList for uint32

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
Subject: Re: Use T_IntList for uint32
Date: 2020-09-01 03:21:28
Message-ID: CAA4eK1L9DseQhgF6kcbzTGsijigrndwaCtoNk+JbfDDkVQ6dFA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 31, 2020 at 6:58 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> writes:
> > Currently pg_list.h doesn't have a variant for uint32 list (like
> > T_UIntList), is there a reason other than that that we don't need it
> > till now?
>
> I'm not in favor of adding another list variant code just for that;
> the overhead is nonzero, and the gain negligible. (I think the reason
> we have OID lists is the idea that someday we'd want to make OID 64-bit.
> A list type defined as "UInt" would offer no such future-proofing.)
>

I agree with this and I also don't want to add more code for this
unless it is really required. Having said that, the case for Xids is
similar to Oids where someday we might want it to be 64-bit but we can
leave it for another day.

> The code you quote probably ought to be casting the result of lfirst_int
> to uint32, but I see no reason to work harder.
>

Sounds reasonable, will use this for now.

--
With Regards,
Amit Kapila.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2020-09-01 03:23:33 Re: Use T_IntList for uint32
Previous Message Michael Paquier 2020-09-01 03:12:54 Re: doc review for v13