Skip to content

Commit ad41cd6

Browse files
committed
Adjust expected output for new functions.
1 parent a804f9c commit ad41cd6

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

src/test/regress/expected/inherit.out

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,3 +570,46 @@ SELECT relname, bar.* FROM bar, pg_class where bar.tableoid = pg_class.oid;
570570
bar2 | 3 | 103
571571
(8 rows)
572572

573+
/* Test inheritance of structure (LIKE) */
574+
CREATE TABLE inhx (xx text DEFAULT 'text');
575+
/*
576+
* Test double inheritance
577+
*
578+
* Ensure that defaults are NOT included unless
579+
* INCLUDING DEFAULTS is specified
580+
*/
581+
CREATE TABLE inhe (ee text, LIKE inhx) inherits (b);
582+
INSERT INTO inhe VALUES ('ee-col1', 'ee-col2', DEFAULT, 'ee-col4');
583+
SELECT * FROM inhe; /* Columns aa, bb, xx value NULL, ee */
584+
aa | bb | ee | xx
585+
---------+---------+----+---------
586+
ee-col1 | ee-col2 | | ee-col4
587+
(1 row)
588+
589+
SELECT * FROM inhx; /* Empty set since LIKE inherits structure only */
590+
xx
591+
----
592+
(0 rows)
593+
594+
SELECT * FROM b; /* Has ee entry */
595+
aa | bb
596+
---------+---------
597+
ee-col1 | ee-col2
598+
(1 row)
599+
600+
SELECT * FROM a; /* Has ee entry */
601+
aa
602+
---------
603+
ee-col1
604+
(1 row)
605+
606+
CREATE TABLE inhf (LIKE inhx, LIKE inhx); /* Throw error */
607+
ERROR: CREATE TABLE: attribute "xx" duplicated
608+
CREATE TABLE inhf (LIKE inhx INCLUDING DEFAULTS);
609+
INSERT INTO inhf DEFAULT VALUES;
610+
SELECT * FROM inhf; /* Single entry with value 'text' */
611+
xx
612+
------
613+
text
614+
(1 row)
615+

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy