Re: Improper use about DatumGetInt32

Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>

From: Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
To: Anastasia Lubennikova <a.lubennikova@postgrespro.ru>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>, Ashutosh Bapat <ashutosh.bapat@2ndquadrant.com>, Alvaro Herrera <alvherre@alvh.no-ip.org>, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Robert Haas <robertmhaas@gmail.com>, Andres Freund <andres@anarazel.de>, "Hou, Zhijie" <houzj.fnst@cn.fujitsu.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2020-11-27T12:33:36Z
Lists: pgsql-hackers
On Wed, Nov 25, 2020 at 8:13 PM Anastasia Lubennikova <
a.lubennikova@postgrespro.ru> wrote:

> On 02.11.2020 18:59, Peter Eisentraut wrote:
> > I have committed 0003.
> >
> > For 0001, normal_rand(), I think you should reject negative arguments
> > with an error.
>
> I've updated 0001. The change is trivial, see attached.
>
> >
> > For 0002, I think you should change the block number arguments to
> > int8, same as other contrib modules do.
> >
> Agree. It will need a bit more work, though. Probably a new version of
> pageinspect contrib, as the public API will change.
> Ashutosh, are you going to continue working on it?
>

Sorry I was away on Diwali vacation so couldn't address Peter's comments in
time. Thanks for taking this further. I will review Peter's patch.

--
Best Wishes,
Ashutosh

Commits

  1. pageinspect: Change block number arguments to bigint

  2. tablefunc: Reject negative number of tuples passed to normal_rand()

  3. Use PG_GETARG_TRANSACTIONID where appropriate