Re: pg_stat_get_replication_slot() marked not strict, crashes - Mailing list pgsql-hackers

From Andres Freund
Subject Re: pg_stat_get_replication_slot() marked not strict, crashes
Date
Msg-id 20220326215223.k5ucyeeggwlex3xs@alap3.anarazel.de
Whole thread Raw
In response to Re: pg_stat_get_replication_slot() marked not strict, crashes  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pg_stat_get_replication_slot() marked not strict, crashes  (Masahiko Sawada <sawada.mshk@gmail.com>)
List pgsql-hackers
Hi,

On 2022-03-26 17:41:53 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > I wonder if we ought to make PG_GETARG_DATUM(n) assert that !PG_ARGISNULL(n)?
> > That'd perhaps make it easier to catch some of these...
> 
> Don't see the point; such cases will crash just fine without any
> assert.  The problem is lack of test coverage ...

Not reliably. Byval types typically won't crash, just do something
bogus. As e.g. in the case of pg_stat_get_subscription_stats(NULL) I found to
also be wrong upthread.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Why is lorikeet so unstable in v14 branch only?
Next
From: Tomas Vondra
Date:
Subject: Re: Column Filtering in Logical Replication