Re: Assert single row returning SQL-standard functions

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Vik Fearing <vik(at)postgresfriends(dot)org>
Cc: Joel Jacobson <joel(at)compiler(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Assert single row returning SQL-standard functions
Date: 2025-08-29 14:08:00
Message-ID: CAFj8pRDZyGAepqnBhU1K1hH5oPPgYo=4NwEmZ6-zCYmM0qkPjQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

pá 29. 8. 2025 v 15:47 odesílatel Vik Fearing <vik(at)postgresfriends(dot)org>
napsal:

>
> On 29/08/2025 12:06, Pavel Stehule wrote:
>
> > I can imagine allowing the NOT NULL flag for functions, and then the
>> > result can be checked on NOT NULL value.
>>
>> I like the idea of a NOT NULL flag for functions.
>> What syntax could we image for that?
>>
>
> CREATE OR REPLACE FUNCTION foo() RETURNS int NOT NULL AS $$ SELECT 10 $$
> LANGUAGE ...
>
>
> What if the function is supposed to return NULL sometimes? The point here
> is not the value but the row count.
>
yes, it doesn't 100% cover Joel's proposal. It can work for naturally NOT
NULL domains only.

> --
>
> Vik Fearing
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Vik Fearing 2025-08-29 14:09:17 Re: Assert single row returning SQL-standard functions
Previous Message David G. Johnston 2025-08-29 14:07:39 Re: Assert single row returning SQL-standard functions