Re: Improper use about DatumGetInt32

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(at)2ndquadrant(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, "Hou, Zhijie" <houzj(dot)fnst(at)cn(dot)fujitsu(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Improper use about DatumGetInt32
Date: 2020-11-26 13:27:12
Message-ID: 20201126132712.GA4301@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020-Nov-26, Peter Eisentraut wrote:

> The point of the patch is to have the range check somewhere. If you just
> cast it, then you won't notice out of range arguments. Note that other
> contrib modules that take block numbers work the same way.

I'm not saying not to do that; just saying we should not propagate it to
places that don't need it. get_raw_page gets its page number from
PG_GETARG_INT64(), and the range check should be there. But then it
calls get_raw_page_internal, and it could pass a BlockNumber -- there's
no need to pass an int64. So get_raw_page_internal does not need a
range check.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2020-11-26 13:43:48 Re: Allow some recovery parameters to be changed with reload
Previous Message Daniil Zakhlystov 2020-11-26 13:15:42 Re: libpq compression