agora inbox for pgsql-docs@postgresql.org  
help / color / mirror / Atom feed
From: Philipp Salvisberg <philipp.salvisberg@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: Undocumented optionality of handler_statements
Date: Fri, 13 Sep 2024 17:28:58 +0200
Message-ID: <C34B148F-D54B-46DF-A497-AC02E5AD3810@gmail.com> (raw)
In-Reply-To: <ZuE6ndanu0Z_9NWM@paquier.xyz>
References: <172165655256.710.2097726158572647813@wrigleys.postgresql.org>
	<Zp7tqLSTbBaBTUlP@paquier.xyz>
	<D88C77BC-7C03-4802-B1C3-B6BB83437184@gmail.com>
	<ZuE6ndanu0Z_9NWM@paquier.xyz>

>> Therefore, I suggest to change this example by adding a NULL
>> statement as in other examples. This change would make the
>> documentation consistent and handle the optionality of
>> handler_statements as an implementation detail. I created a patch
>> for plpgsql.sgml based on the master branch, adding a NULL statement
>> in empty exception handlers (see attached file
>> doc_patch_using_null_stmt_instead_of_empty_exception_handler_v1.diff).
> 
> These examples have been around for 20 years with, and I think that it
> is helpful to show this pattern as well.  So if I were to do something
> about that, I would suggest the attached.

I agree. Expressing the optionality in the synopsis/EBNF is the
better way. Therefore I suggest adding the optionality also for the 
"statements" in this section (43.6.8. Trapping Errors). And of course,
the optionality should be added for all related "statements" in other
sections such as 

- 43.2. Structure of PL/pgSQL
- 43.6.4.1. IF-THEN 
- 43.6.4.2. IF-THEN-ELSE
- 43.6.4.3. IF-THEN-ELSIF
- 43.6.4.4. Simple CASE
- 43.6.4.5. Searched CASE 
- 43.6.5.1. LOOP
- 43.6.5.4. WHILE
- 43.6.5.5. FOR (Integer Variant)
- 43.6.6. Looping through Query Results
- 43.6.7. Looping through Arrays
- 43.7.4. Looping through a Cursor's Result

The PL/pgSQL implementation allows empty branches.





view thread (9+ messages)  latest in thread

Message-ID: <C34B148F-D54B-46DF-A497-AC02E5AD3810@gmail.com>
Permalink:  ../C34B148F-D54B-46DF-A497-AC02E5AD3810@gmail.com/
Also on:    postgresql.org/message-id/C34B148F-D54B-46DF-A497-AC02E5AD3810@gmail.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: philipp.salvisberg@gmail.com, michael@paquier.xyz, pgsql-docs@lists.postgresql.org
  Subject: Re: Undocumented optionality of handler_statements
  In-Reply-To: <C34B148F-D54B-46DF-A497-AC02E5AD3810@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox