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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Declaring a strict function returns not null / eval speed
Дата
Msg-id 13658.1571581639@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Declaring a strict function returns not null / eval speed  (Tels <nospam-pg-abuse@bloodgate.com>)
Ответы Re: Declaring a strict function returns not null / eval speed
Re: Declaring a strict function returns not null / eval speed
Список pgsql-hackers
Tels <nospam-pg-abuse@bloodgate.com> writes:
> On 2019-10-20 13:30, Andreas Karlsson wrote:
>> Agreed, this sounds like something useful to do since virtually all
>> strict functions cannot return NULL, especially the ones which are
>> used in tight loops. The main design issue seems to be to think up a
>> name for this new level of strictness which is not too confusing for
>> end users.

> STRICT NONULL? That way you could do

>    CREATE FUNCTION f1 ... STRICT;
>    CREATE FUNCTION f2 ... STRICT NONULL;
>    CREATE FUNCTION f3 ... NONULL;

> and the last wold throw "not implementet yet"? "NEVER RETURNS NULL" 
> would also ryme with the existing "RETURNS NULL ON NULL INPUT", but I 
> find the verbosity too high.

"RETURNS NOT NULL", perhaps?  That'd have the advantage of not requiring
any new keyword.

I'm a little bit skeptical of the actual value of adding this additional
level of complexity, but I suppose we can't determine that reliably
without doing most of the work :-(

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tels
Дата:
Сообщение: Re: Declaring a strict function returns not null / eval speed
Следующее
От: Tels
Дата:
Сообщение: Re: Declaring a strict function returns not null / eval speed