Little formatting issues in doc

Started by Oli Sennhauser16 days ago5 messagesdocs
Jump to latest
#1Oli Sennhauser
oli.sennhauser@fromdual.com

Hello all

Working with anonymous blocks I recently found a formatting issue which
confused me at the first look:

DO $$DECLARE r record;
BEGIN

Source:
https://www.postgresql.org/docs/current/sql-do.html#SQL-DO-EXAMPLES and
~/src/postgresql/doc/src/sgml/ref/do.sgml

Suggested improvement:

DO $$
DECLARE
    r record;
BEGIN

Shall I write a patch for this? Anybody willing to look at a patch?

<programlisting>
DO $$
DECLARE
    r record;
BEGIN
    FOR r IN SELECT table_schema, table_name FROM information_schema.tables
             WHERE table_type = 'VIEW' AND table_schema = 'public'
    LOOP
        EXECUTE 'GRANT ALL ON ' || quote_ident(r.table_schema) || '.'
|| quote_ident(r.table_name) || ' TO webuser';
    END LOOP;
END$$;
</programlisting></para>

Searching further for similar issues I found this:

RETURNS BOOLEAN AS $$
DECLARE passed BOOLEAN;
BEGIN

Same case. Shall I write a patch for this?

Source: https://www.postgresql.org/docs/current/sql-createfunction.html

Regards,
Oli

--

FromDual - Neutral and vendor independent MariaDB, MySQL and PostgreSQL services.

FromDual GmbH Rebenweg 6
CH - 8610 Uster
Oli Sennhauser CEO / Senior Consultant
Phone: +41 44 500 58 20 Mobile: +41 79 830 09 33
oli.sennhauser@fromdual.com https://www.fromdual.com
Twitter: fromdual

Attachments:

OpenPGP_0xB58CF11D3C9DDEA9.ascapplication/pgp-keys; name=OpenPGP_0xB58CF11D3C9DDEA9.ascDownload
#2Daniel Gustafsson
daniel@yesql.se
In reply to: Oli Sennhauser (#1)
Re: Little formatting issues in doc

On 29 Sep 2026, at 11:20, Oli Sennhauser <oli.sennhauser@fromdual.com> wrote:

Shall I write a patch for this? Anybody willing to look at a patch?

Please do (for both).

--
Daniel Gustafsson

#3David Rowley
dgrowleyml@gmail.com
In reply to: Daniel Gustafsson (#2)
Re: Little formatting issues in doc

On Wed, 30 Sept 2026 at 01:56, Daniel Gustafsson <daniel@yesql.se> wrote:

On 29 Sep 2026, at 11:20, Oli Sennhauser <oli.sennhauser@fromdual.com> wrote:

Shall I write a patch for this? Anybody willing to look at a patch?

Please do (for both).

Sorry, some crossfire here. I pushed the fix for the obviously broken
one. I didn't feel the need to standardise on "DECLARE" being on its
own line. There are other examples that declare the single variable on
the same line. Plenty of ones for cursors.

cd doc && git grep -E "^\s*DECLARE"

I feel like if we adjusted the "DECLARE passed BOOLEAN;" one, the
floodgates would open for the remainder.

David

#4Oli Sennhauser
oli.sennhauser@fromdual.com
In reply to: David Rowley (#3)
Re: Little formatting issues in doc

OK. Thanks, David!

Question: How frequently is the documentation built and published?

From the HTML code I can see something like this:

<meta property="article:published_time"
content="2026-08-13T12:52:54.741344" />

which looks like: "Not daily".

Thanks,
Oli

On 29/09/2026 15:24, David Rowley wrote:

On Wed, 30 Sept 2026 at 01:56, Daniel Gustafsson<daniel@yesql.se> wrote:

On 29 Sep 2026, at 11:20, Oli Sennhauser<oli.sennhauser@fromdual.com> wrote:
Shall I write a patch for this? Anybody willing to look at a patch?

Please do (for both).

Sorry, some crossfire here. I pushed the fix for the obviously broken
one. I didn't feel the need to standardise on "DECLARE" being on its
own line. There are other examples that declare the single variable on
the same line. Plenty of ones for cursors.

cd doc && git grep -E "^\s*DECLARE"

I feel like if we adjusted the "DECLARE passed BOOLEAN;" one, the
floodgates would open for the remainder.

David

--

FromDual - Neutral and vendor independent MariaDB, MySQL and PostgreSQL services.

FromDual GmbH Rebenweg 6
CH - 8610 Uster
Oli Sennhauser CEO / Senior Consultant
Phone: +41 44 500 58 20 Mobile: +41 79 830 09 33
oli.sennhauser@fromdual.com https://www.fromdual.com
Twitter: fromdual

Attachments:

OpenPGP_0xB58CF11D3C9DDEA9.ascapplication/pgp-keys; name=OpenPGP_0xB58CF11D3C9DDEA9.ascDownload
#5Daniel Gustafsson
daniel@yesql.se
In reply to: Oli Sennhauser (#4)
Re: Little formatting issues in doc

On 29 Sep 2026, at 17:34, Oli Sennhauser <oli.sennhauser@fromdual.com> wrote:

Question: How frequently is the documentation built and published?
From the HTML code I can see something like this:
<meta property="article:published_time" content="2026-08-13T12:52:54.741344" />
which looks like: "Not daily".

The devel branch documentation is built daily, but for the backbranches the
documentation is built once per release and reflects the documentation at the
time of the release.

--
Daniel Gustafsson