aboutsummaryrefslogtreecommitdiff
path: root/src/test/regress/expected/indexing.out
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/regress/expected/indexing.out')
-rw-r--r--src/test/regress/expected/indexing.out41
1 files changed, 15 insertions, 26 deletions
diff --git a/src/test/regress/expected/indexing.out b/src/test/regress/expected/indexing.out
index 5351a874258..1bdd430f063 100644
--- a/src/test/regress/expected/indexing.out
+++ b/src/test/regress/expected/indexing.out
@@ -1065,18 +1065,16 @@ create table idxpart3 (b int not null, a int not null);
alter table idxpart attach partition idxpart3 for values from (20, 20) to (30, 30);
select conname, contype, conrelid::regclass, conindid::regclass, conkey
from pg_constraint where conrelid::regclass::text like 'idxpart%'
- order by conrelid::regclass::text, conname;
- conname | contype | conrelid | conindid | conkey
----------------------+---------+-----------+----------------+--------
- idxpart_pkey | p | idxpart | idxpart_pkey | {1,2}
- idxpart1_pkey | p | idxpart1 | idxpart1_pkey | {1,2}
- idxpart2_pkey | p | idxpart2 | idxpart2_pkey | {1,2}
- idxpart21_pkey | p | idxpart21 | idxpart21_pkey | {1,2}
- idxpart22_pkey | p | idxpart22 | idxpart22_pkey | {1,2}
- idxpart3_a_not_null | n | idxpart3 | - | {2}
- idxpart3_b_not_null | n | idxpart3 | - | {1}
- idxpart3_pkey | p | idxpart3 | idxpart3_pkey | {2,1}
-(8 rows)
+ order by conname;
+ conname | contype | conrelid | conindid | conkey
+----------------+---------+-----------+----------------+--------
+ idxpart1_pkey | p | idxpart1 | idxpart1_pkey | {1,2}
+ idxpart21_pkey | p | idxpart21 | idxpart21_pkey | {1,2}
+ idxpart22_pkey | p | idxpart22 | idxpart22_pkey | {1,2}
+ idxpart2_pkey | p | idxpart2 | idxpart2_pkey | {1,2}
+ idxpart3_pkey | p | idxpart3 | idxpart3_pkey | {2,1}
+ idxpart_pkey | p | idxpart | idxpart_pkey | {1,2}
+(6 rows)
drop table idxpart;
-- Verify that multi-layer partitioning honors the requirement that all
@@ -1209,21 +1207,12 @@ create table idxpart (a int) partition by range (a);
create table idxpart0 (like idxpart);
alter table idxpart0 add unique (a);
alter table idxpart attach partition idxpart0 default;
-alter table only idxpart add primary key (a); -- works, but idxpart0.a is nullable
-\d idxpart0
- Table "public.idxpart0"
- Column | Type | Collation | Nullable | Default
---------+---------+-----------+----------+---------
- a | integer | | |
-Partition of: idxpart DEFAULT
-Indexes:
- "idxpart0_a_key" UNIQUE CONSTRAINT, btree (a)
-
-alter index idxpart_pkey attach partition idxpart0_a_key; -- fails, lacks NOT NULL
-ERROR: invalid primary key definition
-DETAIL: Column "a" of relation "idxpart0" is not marked NOT NULL.
+alter table only idxpart add primary key (a); -- fail, no NOT NULL constraint
+ERROR: constraint must be added to child tables too
+DETAIL: Column "a" of relation "idxpart0" is not already NOT NULL.
+HINT: Do not specify the ONLY keyword.
alter table idxpart0 alter column a set not null;
-alter index idxpart_pkey attach partition idxpart0_a_key;
+alter table only idxpart add primary key (a); -- now it works
alter table idxpart0 alter column a drop not null; -- fail, pkey needs it
ERROR: column "a" is marked NOT NULL in parent table
drop table idxpart;