bar2 | 3 | 103
(8 rows)
+/* Test inheritance of structure (LIKE) */
+CREATE TABLE inhx (xx text DEFAULT 'text');
+/*
+ * Test double inheritance
+ *
+ * Ensure that defaults are NOT included unless
+ * INCLUDING DEFAULTS is specified
+ */
+CREATE TABLE inhe (ee text, LIKE inhx) inherits (b);
+INSERT INTO inhe VALUES ('ee-col1', 'ee-col2', DEFAULT, 'ee-col4');
+SELECT * FROM inhe; /* Columns aa, bb, xx value NULL, ee */
+ aa | bb | ee | xx
+---------+---------+----+---------
+ ee-col1 | ee-col2 | | ee-col4
+(1 row)
+
+SELECT * FROM inhx; /* Empty set since LIKE inherits structure only */
+ xx
+----
+(0 rows)
+
+SELECT * FROM b; /* Has ee entry */
+ aa | bb
+---------+---------
+ ee-col1 | ee-col2
+(1 row)
+
+SELECT * FROM a; /* Has ee entry */
+ aa
+---------
+ ee-col1
+(1 row)
+
+CREATE TABLE inhf (LIKE inhx, LIKE inhx); /* Throw error */
+ERROR: CREATE TABLE: attribute "xx" duplicated
+CREATE TABLE inhf (LIKE inhx INCLUDING DEFAULTS);
+INSERT INTO inhf DEFAULT VALUES;
+SELECT * FROM inhf; /* Single entry with value 'text' */
+ xx
+------
+ text
+(1 row)
+