lbound1 default in buildint2vector/buildoidvector

From: Kohei KaiGai <kaigai(at)heterodb(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: lbound1 default in buildint2vector/buildoidvector
Date: 2018-11-15 02:51:31
Message-ID: CAOP8fzaW+ztwSOR0GJFfSAaFFxYmCfOpTw1OVMFad-fJ52TxyQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

I noticed buildint2vector / buildoidvector assigns lbound1=0 as default
value, but array type shall have lbound1=1 in the default.
Is there some reasons for the difference?

When I made a simple C-function that returns result of int2vector which
carries attribute numbers of the argument.

postgres=# select attnums_of('t0','{aid,cid,bid}');
attnums_of
---------------
[0:2]={3,5,4}
(1 row)

Once it assigns lbound1=1 manually,

postgres=# select attnums_of('t0','{aid,cid,bid}');
attnums_of
------------
{3,5,4}
(1 row)

Maybe, the later one is natural.
Of course, these APIs are mostly internal, so lbound1 setting is not
significant so much.

Thanks,
--
HeteroDB, Inc / The PG-Strom Project
KaiGai Kohei <kaigai(at)heterodb(dot)com>

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2018-11-15 03:28:43 Re: DSM segment handle generation in background workers
Previous Message Amit Langote 2018-11-15 02:03:07 Re: ATTACH/DETACH PARTITION CONCURRENTLY