Domingo, Bruce,
 
sorry for the error. It was caused by my server using Tomcat's default maxPostSize of 2MB, which
is not sufficient for the diagrams generated from the Postgres grammar. I have now extended it
to 10MB.
 
By the way, I had already created diagrams for PostgreSQL back in 2017, please find them here:

https://cdn.rawgit.com/GuntherRademacher/1e5a275f433fdc61bc4e81e24c287d67/raw/7c8599f5d2bf8450c52750abd70bb4bc90369bf8/gram.xhtml
 
At the time, this answered a question on StackOverflow, but apparently that question has been
deleted since. Those diagrams were created by pasting the content of
 
https://raw.githubusercontent.com/postgres/postgres/master/src/backend/parser/gram.y
 
to
 
https://bottlecaps.de/convert/
 
then clicking "Convert" and on the bottom of the result page, "View Diagram".
 
Downloading diagrams now works after maxPostSize has been extended on my side.
 
Best regards
Gunther
 
Gesendet: Dienstag, 06. Juli 2021 um 20:04 Uhr
Von: "Domingo Alvarez Duarte" <mingodad@gmail.com>
An: grd@gmx.net
Betreff: Fwd: Grammar railroad diagram

Hello Gunther !

I've sent this to postgresql and they reported the error bellow.

Cheers !

-------- Forwarded Message --------
Subject: Re: Grammar railroad diagram
Date: Tue, 6 Jul 2021 12:51:54 -0400
From: Bruce Momjian <bruce@momjian.us>
To: Domingo Alvarez Duarte <mingodad@gmail.com>
CC: pgsql-hackers@lists.postgresql.org


On Sat, Jul 3, 2021 at 10:39:02AM +0200, Domingo Alvarez Duarte wrote:
I've done a experimental tool to convert bison grammars to a kind of EBNF
understood by https://www.bottlecaps.de/rr/ui to generate railroad diagrams see
bellow the converted 'postgresql-13.3/src/backend/parser/gram.y' and with some
hand made changes to allow view it at https://www.bottlecaps.de/rr/ui the order
of the rules could be changed to a better view of the railroad diagrams. Copy
and paste the EBNF bellow on https://www.bottlecaps.de/rr/ui tab Edit Grammar
then switch to the tab View Diagram.

That is pretty cool. I had trouble figuring out how to get it working,
so here are the steps I used:

1. save my attachment (created by Domingo)
2. go to https://www.bottlecaps.de/rr/ui
3. select "Edit Grammar"
4. choose "Browse" at the bottom
5. select the attachment you saved in #1
6. choose "Load" at the bottom
7. select "View Diagram"

You can even click on the yellow boxes to see the sub-grammar. People
have asked for railroad diagrams in the past, and this certainly
produces them, and "Options" allows many customizations.

I tried downloading as XHTML+SVG and HTML+PNG but got an error:

HTTP Status 500 – Internal Server Error

Type Exception Report

Message The multi-part request contained parameter data (excluding
uploaded files) that exceeded the limit for maxPostSize set on the
associated connector

Description The server encountered an unexpected condition that
prevented it from fulfilling the request.

It might be nice to download this output and host it on the Postgres
website at some point.
 
--
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  If only the physical world exists, free will is an illusion.