Re: Error-safe user functions

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)anarazel(dot)de>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Joe Conway <mail(at)joeconway(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Corey Huinker <corey(dot)huinker(at)gmail(dot)com>, Nikita Glukhov <n(dot)gluhov(at)postgrespro(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Error-safe user functions
Date: 2022-12-06 15:43:03
Message-ID: f83f0176-b870-3fd8-d302-b86b6f504ac6@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 2022-12-06 Tu 09:42, Tom Lane wrote:
> [ continuing the naming quagmire... ]
>
> I wrote:
>> Andres Freund <andres(at)anarazel(dot)de> writes:
>>> Not that I have a suggestion for a better name, but I don't particularly
>>> like "Safe" denoting non-erroring input function calls. There's too many
>>> interpretations of safe - e.g. safe against privilege escalation issues
>>> or such.
>> Yeah, I'm not that thrilled with it either --- but it's a reasonably
>> on-point modifier, and short.
> It occurs to me that another spelling could be NoError (or _noerror
> where not using camel case). There's some precedent for that already;
> and where we have it, it has the same implication of reporting rather
> than throwing certain errors, without making a guarantee about all
> errors. For instance lookup_rowtype_tupdesc_noerror won't prevent
> throwing errors if catalog corruption is detected inside the catcaches.
>
> I'm not sure this is any *better* than Safe ... it's longer, less
> mellifluous, and still subject to misinterpretation. But it's
> a possible alternative.
>
>

Yeah, I don't think there's terribly much to choose between 'safe' and
'noerror' in terms of meaning.

I originally chose InputFunctionCallContext as a more neutral name in
case we wanted to be able to pass some other sort of node for the
context in future.

Maybe that was a little too forward looking.

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message gkokolatos 2022-12-06 15:52:01 Re: Add LZ4 compression in pg_dump
Previous Message Alvaro Herrera 2022-12-06 15:19:05 Re: ExecRTCheckPerms() and many prunable partitions