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

Commitc31e9d4

Browse files
committed
Improve error message when skipping scan of default partition.
It seems like a good idea to clearly distinguish between skipping thescan of the new partition itself and skipping the scan of the defaultpartition.Amit LangoteDiscussion:http://postgr.es/m/1f08b844-0078-aa8d-452e-7af3bf77d05f@lab.ntt.co.jp
1 parente9baa5e commitc31e9d4

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

‎src/backend/commands/tablecmds.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13635,9 +13635,14 @@ ValidatePartitionConstraints(List **wqueue, Relation scanrel,
1363513635
*/
1363613636
if (PartConstraintImpliedByRelConstraint(scanrel,partConstraint))
1363713637
{
13638-
ereport(INFO,
13639-
(errmsg("partition constraint for table \"%s\" is implied by existing constraints",
13640-
RelationGetRelationName(scanrel))));
13638+
if (!validate_default)
13639+
ereport(INFO,
13640+
(errmsg("partition constraint for table \"%s\" is implied by existing constraints",
13641+
RelationGetRelationName(scanrel))));
13642+
else
13643+
ereport(INFO,
13644+
(errmsg("updated partition constraint for default partition \"%s\" is implied by existing constraints",
13645+
RelationGetRelationName(scanrel))));
1364113646
return;
1364213647
}
1364313648

‎src/test/regress/expected/alter_table.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3436,7 +3436,7 @@ ALTER TABLE part_7 ATTACH PARTITION part_7_a_null FOR VALUES IN ('a', null);
34363436
INFO: partition constraint for table "part_7_a_null" is implied by existing constraints
34373437
ALTER TABLE list_parted2 ATTACH PARTITION part_7 FOR VALUES IN (7);
34383438
INFO: partition constraint for table "part_7" is implied by existing constraints
3439-
INFO: partition constraint fortable "list_parted2_def" is implied by existing constraints
3439+
INFO:updatedpartition constraint fordefault partition "list_parted2_def" is implied by existing constraints
34403440
-- Same example, but check this time that the constraint correctly detects
34413441
-- violating rows
34423442
ALTER TABLE list_parted2 DETACH PARTITION part_7;
@@ -3450,7 +3450,7 @@ SELECT tableoid::regclass, a, b FROM part_7 order by a;
34503450
(2 rows)
34513451

34523452
ALTER TABLE list_parted2 ATTACH PARTITION part_7 FOR VALUES IN (7);
3453-
INFO: partition constraint fortable "list_parted2_def" is implied by existing constraints
3453+
INFO:updatedpartition constraint fordefault partition "list_parted2_def" is implied by existing constraints
34543454
ERROR: partition constraint is violated by some row
34553455
-- check that leaf partitions of default partition are scanned when
34563456
-- attaching a partitioned table.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp