Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
docs: improve 'capitals' inheritance example
authorBruce Momjian <bruce@momjian.us>
Mon, 31 Aug 2020 17:43:04 +0000 (13:43 -0400)
committerBruce Momjian <bruce@momjian.us>
Mon, 31 Aug 2020 17:43:04 +0000 (13:43 -0400)
Adds constraints and improves wording.

Reported-by: 2552891@gmail.com
Discussion: https://postgr.es/m/159586122762.680.1361378513036616007@wrigleys.postgresql.org

Backpatch-through: 9.5

doc/src/sgml/advanced.sgml

index 1586021c2e756f5d91a58521f166adc20b70f055..7bead13c99758e8974b9b999242f808299369c12 100644 (file)
@@ -617,7 +617,7 @@ CREATE TABLE cities (
 );
 
 CREATE TABLE capitals (
-  state      char(2)
+  state      char(2) UNIQUE NOT NULL
 ) INHERITS (cities);
 </programlisting>
    </para>
@@ -631,7 +631,8 @@ CREATE TABLE capitals (
     <type>text</type>, a native <productname>PostgreSQL</productname>
     type for variable length character strings.  The
     <classname>capitals</> table has
-    an extra column, <structfield>state</>, which shows their states.  In
+    an additional column, <structfield>state</>, which shows its
+    state abbreviation.  In
     <productname>PostgreSQL</productname>, a table can inherit from
     zero or more other tables.
    </para>