Re: Improper use about DatumGetInt32

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Ashutosh Bapat <ashutosh(dot)bapat(at)2ndquadrant(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: 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-25 16:23:20
Message-ID: 5cba03cd-cff3-9f81-ba4f-4fd91e08bbce@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020-11-02 16:59, Peter Eisentraut wrote:
> I have committed 0003.
>
> For 0001, normal_rand(), I think you should reject negative arguments
> with an error.

I have committed a fix for that.

> For 0002, I think you should change the block number arguments to int8,
> same as other contrib modules do.

Looking further into this, almost all of pageinspect needs to be updated
to handle block numbers larger than INT_MAX correctly. Attached is a
patch for this. It is meant to work like other contrib modules, such as
pg_freespace and pg_visibility. I haven't tested this much yet.

Attachment Content-Type Size
0001-pageinspect-Change-block-number-arguments-to-bigint.patch text/plain 13.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-11-25 16:43:27 Re: Libpq support to connect to standby server as priority
Previous Message David G. Johnston 2020-11-25 16:21:35 Re: Transaction isolation and table contraints