Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitad41cd6

Browse files
committed
Adjust expected output for new functions.
1 parenta804f9c commitad41cd6

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)

[8]ページ先頭

©2009-2025 Movatter.jp