Re: Error-safe user functions - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: Error-safe user functions
Date
Msg-id CAKFQuwaEvXTNxS5RHmMkvr9nJELaz51VkrEN4XsPFGHd5vwe3g@mail.gmail.com
Whole thread Raw
In response to Re: Error-safe user functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Error-safe user functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Error-safe user functions  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-hackers
On Wed, Dec 7, 2022 at 9:06 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> Why not do away with two separate functions and define a composite type
> (boolean, text) for is_valid to return?

I don't see any advantage to that.  It would be harder to use in both
use-cases.

I don't really see a use case for either of them individually.  If all you are doing is printing them out in a test and checking the result in what situation wouldn't you want to check that both the true/false and message are as expected?  Plus, you don't have to figure out a name for the second function.
 

>> BTW, does anyone else agree that 9.26 is desperately in need of some
>> <sect2> subdivisions?  It seems to have gotten a lot longer since
>> I looked at it last.

> I'd be inclined to do something like what we are attempting for Chapter 28
> Monitoring Database Activity; introduce pagination through refentry and
> build our own table of contents into it.

I'd prefer to follow the model that already exists in 9.27,
ie break it up with <sect2>'s, which provide a handy
sub-table-of-contents.


I have a bigger issue with the non-pagination myself; the extra bit of effort to manually create a tabular ToC (where we can add descriptions) seems like a worthy price to pay.

Are you suggesting we should not go down the path that v8-0003 does in the monitoring section cleanup thread?  I find the usability of Chapter 54 System Views to be superior to these two run-on chapters and would rather we emulate it in both these places - for what is in the end very little additional effort, all mechanical in nature.

David J.

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Think-o in foreign key comments
Next
From: "David G. Johnston"
Date:
Subject: Re: [DOCS] Stats views and functions not in order?