Re: Improvement of GIN figure

2019-07-13 Thread Jürgen Purtz



On Tue, Jul 9, 2019 at 3:22 PM Tatsuo Ishii  wrote:

I agree that the existing colors look awful, and that muted pastel
colors would work better. Doesn't seem like something that should
happen at the cost of making the diagram less informative, though.

I am not an expert in the area but I think we should cosider people
with color disability.

Good point. I think that that shouldn't be too hard to mostly get right.

It's good that the diagrams will already work with a screen reader.

Due to the discussions of recent days as well as some improvements of 
the graphiz know-how, the graphic is subject to many changes: different 
colors (variations of 'PG blue', and possibly helpful for people with 
color vision deficiency), a different font (adaption to the font in PG's 
documentation), changes in the meaning and explanation of nodes (as a 
result of discussion with Oleg Bartunov), introduction of a - hopefully 
unobtrusive - background color (to circumvent graphic from text), use of 
DOT syntax.








diff --git a/doc/src/sgml/images/README b/doc/src/sgml/images/README
index 07c4580255..c451d4bca4 100644
--- a/doc/src/sgml/images/README
+++ b/doc/src/sgml/images/README
@@ -13,7 +13,8 @@ involve diffable source files.
 These tools are acceptable:
 
 - Graphviz (https://graphviz.org/)
-- Ditaa (http://ditaa.sourceforge.net/)
+- Ditaa (https://github.com/stathissideris/ditaa), version 0.11 or
+  higher. Previous versions does not support SVG.
 
 We use SVG as the format for integrating the image into the ultimate
 output formats of the documentation, that is, HTML, PDF, and others.
diff --git a/doc/src/sgml/images/gin.gv b/doc/src/sgml/images/gin.gv
index 097e91029a..35520736ec 100644
--- a/doc/src/sgml/images/gin.gv
+++ b/doc/src/sgml/images/gin.gv
@@ -1,85 +1,101 @@
 digraph "gin" {
+
 layout=dot;
-node [label="", shape=box, style=filled, fillcolor=gray, width=1.4];
 
-m1 [label="meta page"];
+// default values
+node  [shape=box, label="", fontname="sans-serif", style=filled, fillcolor=lightgray, width=1.4];
+graph [fontname="sans-serif"]; // must be specified separately
+edge  [fontname="sans-serif"]; // must be specified separately
+
+// an unobtrusive background color
+pad="1.0, 0.5";
+bgcolor=whitesmoke;
 
+// The top node
+m1 [label="meta page", style=filled, fillcolor=beige];
+
+// other nodes
 subgraph cluster01 {
-label="entry tree";
-subgraph egroup1 {
-rank=same;
-e1;
-}
-subgraph egroup2 {
-rank=same;
-e2 -> e3 -> e4;
-}
-subgraph egroup3 {
-rank=same;
-e5 -> e6 -> e7 -> e8 -> e9;
-}
-e1 -> e4;
-e1 -> e3;
-e1 -> e2;
-e2 -> e5;
-e2 -> e6;
-e3 -> e7;
-e4 -> e8;
-e4 -> e9;
-
-e6 [fillcolor=green, label="posting list"];
-e8 [fillcolor=green, label="posting list"];
-e9 [fillcolor=green, label="posting list"];
+ bgcolor=white;
+ label="entry tree";
+ subgraph egroup1 {
+  rank=same;
+  e1;
+  }
+  subgraph egroup2 {
+   rank=same;
+   e2 -> e3 -> e4;
+  }
+  subgraph egroup3 {
+   rank=same;
+   e5 -> e6 -> e7 -> e8 -> e9;
+  }
+  e1 -> e4;
+  e1 -> e3;
+  e1 -> e2;
+  e2 -> e5;
+  e2 -> e6;
+  e3 -> e7;
+  e4 -> e8;
+  e4 -> e9;
+
+  e5 [fillcolor=cyan];
+  e6 [fillcolor=cyan];
+  e7 [fillcolor=cyan];
+  e8 [fillcolor=cyan];
+  e9 [fillcolor=cyan];
+
 }
 
 subgraph cluster02 {
-label="posting tree";
-subgraph pgroup1 {
-rank=same;
-p1;
-}
-subgraph pgroup2 {
-rank=same;
-p2 -> p3;
-}
-p1 -> p2;
-p1 -> p3;
-
-p2 [fillcolor=green, label="heap ptr"];
-p3 [fillcolor=green, label="heap ptr"];
+ bgcolor=white;
+ label="posting tree";
+ subgraph pgroup1 {
+  p1;
+ }
+ subgraph pgroup2 {
+  rank=same;
+

Outdated tip in the "Adding a column section"

2019-07-13 Thread Daniel Westermann (DWE)
Hi,

https://www.postgresql.org/docs/current/ddl-alter.html

Tip

Adding a column with a default requires updating each row of the table (to 
store the new column value). However, if no default is specified, PostgreSQL is 
able to avoid the physical update. So if you intend to fill the column with 
mostly nondefault values, it's best to add the column with no default, insert 
the correct values using UPDATE, and then add any desired default as described 
below.

This is not true anymore since PostgreSQL 11, isn't it? If agreed, I would try 
to write my first patch to remove that.

Regards
Daniel