Re: Declaring a strict function returns not null / eval speed - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Declaring a strict function returns not null / eval speed
Date
Msg-id 821.1571771210@sss.pgh.pa.us
Whole thread Raw
In response to Re: Declaring a strict function returns not null / eval speed  (Andres Freund <andres@anarazel.de>)
Responses Re: Declaring a strict function returns not null / eval speed
Re: Declaring a strict function returns not null / eval speed
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2019-10-20 10:27:19 -0400, Tom Lane wrote:
>> "RETURNS NOT NULL", perhaps?  That'd have the advantage of not requiring
>> any new keyword.

> That could work.

Actually, I think we probably don't need any SQL representation of this
at all, because if what you're going to do with it is omit logically
necessary null-value checks, then a wrong setting would trivially crash
the server.  Therefore, we can never give the ability to set this flag
to users; we could only set it on built-in functions.

(But that saves a lot of work, eg dump/restore support isn't needed
either.)

This doesn't seem too awful to me, because non-builtin functions are
most likely slow enough that it doesn't matter.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Alexey Kondratov
Date:
Subject: Re: PATCH: logical_work_mem and logical streaming of largein-progress transactions
Next
From: Christoph Berg
Date:
Subject: Re: Declaring a strict function returns not null / eval speed