Re: Improper use about DatumGetInt32

Peter Eisentraut <peter.eisentraut@enterprisedb.com>

From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>, Ashutosh Bapat <ashutosh.bapat@2ndquadrant.com>, 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-30T14:50:46Z
Lists: pgsql-hackers

Attachments

On 2020-11-27 13:37, Ashutosh Bapat wrote:
>     Yeah, I had it like that for a moment, but then you need to duplicate
>     the check in get_raw_page() and get_raw_page_fork().  I figured since
>     get_raw_page_internal() does all the other argument checking also, it
>     seems sensible to put the block range check there too.  But it's not a
>     big deal either way.
> 
> 
> FWIW, my 2c. Though I agree with both sides, I 
> prefer get_raw_page_internal() accepting BlockNumber, since that's what 
> it deals with and not the entire int8.

Patch updated this way.  I agree it's better that way.

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