Re: Declaring a strict function returns not null / eval speed

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tels <nospam-pg-abuse(at)bloodgate(dot)com>, Andreas Karlsson <andreas(at)proxel(dot)se>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Declaring a strict function returns not null / eval speed
Date: 2019-10-22 19:06:50
Message-ID: 821.1571771210@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christoph Berg 2019-10-22 19:18:45 Re: Declaring a strict function returns not null / eval speed
Previous Message Alexey Kondratov 2019-10-22 19:02:38 Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions