@@ -8,8 +8,8 @@ SELECT plan(102);
8
8
SET client_min_messages = warning;
9
9
10
10
-- Create inherited tables (not partitions).
11
- CREATE TABLE public .parent (id INT PRIMARY KEY );
12
- CREATE TABLE public .child (id INT PRIMARY KEY ) INHERITS (public .parent );
11
+ CREATE TABLE public .base (id INT PRIMARY KEY );
12
+ CREATE TABLE public .sub (id INT PRIMARY KEY ) INHERITS (public .base );
13
13
14
14
-- Create a partitioned table with two partitions.
15
15
CREATE TABLE public .parted(id INT NOT NULL ) PARTITION BY RANGE (id);
@@ -67,49 +67,49 @@ SELECT * FROM check_test(
67
67
68
68
-- is_partition_of() should fail for inherited but not partitioned tables.
69
69
SELECT * FROM check_test(
70
- is_partition_of( ' public' , ' child ' , ' public' , ' parent ' , ' whatevs' ),
70
+ is_partition_of( ' public' , ' sub ' , ' public' , ' base ' , ' whatevs' ),
71
71
false,
72
72
' is_partition_of( csch, non-part ctab, psch, non-part ptab, desc )' ,
73
73
' whatevs' ,
74
74
' '
75
75
);
76
76
77
77
SELECT * FROM check_test(
78
- is_partition_of( ' child ' , ' parent ' , ' whatevs' ),
78
+ is_partition_of( ' sub ' , ' base ' , ' whatevs' ),
79
79
false,
80
80
' is_partition_of( non-part ctab, non-part ptab, desc )' ,
81
81
' whatevs' ,
82
82
' '
83
83
);
84
84
85
- -- is_partition_of() should fail for parted table and non-part child .
85
+ -- is_partition_of() should fail for parted table and non-part sub .
86
86
SELECT * FROM check_test(
87
- is_partition_of( ' public' , ' child ' , ' public' , ' parted' , ' whatevs' ),
87
+ is_partition_of( ' public' , ' sub ' , ' public' , ' parted' , ' whatevs' ),
88
88
false,
89
89
' is_partition_of( csch, non-part ctab, psch, ptab, desc )' ,
90
90
' whatevs' ,
91
91
' '
92
92
);
93
93
94
94
SELECT * FROM check_test(
95
- is_partition_of( ' child ' , ' parted' , ' whatevs' ),
95
+ is_partition_of( ' sub ' , ' parted' , ' whatevs' ),
96
96
false,
97
97
' is_partition_of( non-part ctab, ptab, desc )' ,
98
98
' whatevs' ,
99
99
' '
100
100
);
101
101
102
- -- is_partition_of() should fail for partition child but wrong parent .
102
+ -- is_partition_of() should fail for partition sub but wrong base .
103
103
SELECT * FROM check_test(
104
- is_partition_of( ' public' , ' part1' , ' public' , ' parent ' , ' whatevs' ),
104
+ is_partition_of( ' public' , ' part1' , ' public' , ' base ' , ' whatevs' ),
105
105
false,
106
106
' is_partition_of( csch, ctab, psch, non-part ptab, desc )' ,
107
107
' whatevs' ,
108
108
' '
109
109
);
110
110
111
111
SELECT * FROM check_test(
112
- is_partition_of( ' part1' , ' parent ' , ' whatevs' ),
112
+ is_partition_of( ' part1' , ' base ' , ' whatevs' ),
113
113
false,
114
114
' is_partition_of( ctab, non-part ptab, desc )' ,
115
115
' whatevs' ,
@@ -152,7 +152,7 @@ SELECT * FROM check_test(
152
152
' '
153
153
);
154
154
155
- -- Should find public partition for hidden parent .
155
+ -- Should find public partition for hidden base .
156
156
SELECT * FROM check_test(
157
157
is_partition_of( ' public' , ' not_hidden_part3' , ' hide' , ' hidden_parted' , ' whatevs' ),
158
158
true,
@@ -307,21 +307,21 @@ SELECT * FROM check_test(
307
307
308
308
-- Should not work for unpartitioned but inherited table
309
309
SELECT * FROM check_test(
310
- partitions_are( ' public' , ' parent ' , ' {child }' , ' hi' ),
310
+ partitions_are( ' public' , ' base ' , ' {sub }' , ' hi' ),
311
311
false,
312
312
' partitions_are( sch, non-parted tab, inherited tab, desc )' ,
313
313
' hi' ,
314
314
' Missing partitions:
315
- child '
315
+ sub '
316
316
);
317
317
318
318
SELECT * FROM check_test(
319
- partitions_are( ' parent ' , ' {child }' ::name[], ' hi' ),
319
+ partitions_are( ' base ' , ' {sub }' ::name[], ' hi' ),
320
320
false,
321
321
' partitions_are( non-parted tab, inherited tab, desc )' ,
322
322
' hi' ,
323
323
' Missing partitions:
324
- child '
324
+ sub '
325
325
);
326
326
327
327
-- Should not work for non-existent table.
0 commit comments