Re: Improper use about DatumGetInt32

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, 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-12-25 07:45:45
Message-ID: X+WYqdK3qKzQGquw@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Dec 04, 2020 at 03:58:22PM -0300, Alvaro Herrera wrote:
> I don't know if it's possible to determine (at function execution time)
> that we're running with the old extension version; if so it might
> suffice to throw a warning but still have the SQL function run the same
> C function.

Hmm. You could look after extversion? Usually we just handle that
with compatibility routines.

> If we really think that we ought to differentiate, then we could do what
> pg_stat_statement does, and have a separate C function that's called
> with the obsolete signature (pg_stat_statements_1_8 et al).

With the 1.8 flavor, it is possible to pass down a negative number
and it may not fail depending on the number of blocks of the relation,
so I think that you had better have a compatibility layer if a user
has the new binaries but is still on 1.8. And that's surely a safe
move.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2020-12-25 07:48:16 Re: Commit fest manager for 2021-01
Previous Message Masahiko Sawada 2020-12-25 07:35:30 Re: Commit fest manager for 2021-01