mirror of
https://github.com/postgres/postgres.git
synced 2026-05-16 03:19:53 -04:00
Message corrections for partition split/merge commands
Fix spelling and grammar, turn an accidental duplicate errmsg into errdetail, and remove an errposition that was not pointing at anything relevant to the error. Author: Ayush Tiwari <ayushtiwari.slg01@gmail.com> Reviewed-by: Jian He <jian.universality@gmail.com> Reviewed-by: Yuchen Li <liyuchen_xyz@163.com> (earlier version) Discussion: https://postgr.es/m/CAJTYsWUvMT5uKOasPnm6-o9CrdXbRONiAYHTKJb7wx66LB8S1A@mail.gmail.com
This commit is contained in:
parent
43fc1dc752
commit
52e629be95
5 changed files with 51 additions and 53 deletions
|
|
@ -23661,7 +23661,7 @@ SplitPartitionMoveRows(List **wqueue, Relation rel, Relation splitRel,
|
|||
else
|
||||
ereport(ERROR,
|
||||
errcode(ERRCODE_CHECK_VIOLATION),
|
||||
errmsg("can not find partition for split partition row"),
|
||||
errmsg("cannot find partition for split partition row"),
|
||||
errtable(splitRel));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3540,8 +3540,8 @@ checkPartition(Relation rel, Oid partRelOid, bool isMerge)
|
|||
errcode(ERRCODE_WRONG_OBJECT_TYPE),
|
||||
errmsg("\"%s\" is not a table", RelationGetRelationName(partRel)),
|
||||
isMerge
|
||||
? errhint("ALTER TABLE ... MERGE PARTITIONS can only merge partitions don't have sub-partitions.")
|
||||
: errhint("ALTER TABLE ... SPLIT PARTITION can only split partitions don't have sub-partitions."));
|
||||
? errhint("ALTER TABLE ... MERGE PARTITIONS can only merge partitions that don't have sub-partitions.")
|
||||
: errhint("ALTER TABLE ... SPLIT PARTITION can only split partitions that don't have sub-partitions."));
|
||||
|
||||
if (!partRel->rd_rel->relispartition)
|
||||
ereport(ERROR,
|
||||
|
|
@ -3549,8 +3549,8 @@ checkPartition(Relation rel, Oid partRelOid, bool isMerge)
|
|||
errmsg("\"%s\" is not a partition of partitioned table \"%s\"",
|
||||
RelationGetRelationName(partRel), RelationGetRelationName(rel)),
|
||||
isMerge
|
||||
? errhint("ALTER TABLE ... MERGE PARTITIONS can only merge partitions don't have sub-partitions.")
|
||||
: errhint("ALTER TABLE ... SPLIT PARTITION can only split partitions don't have sub-partitions."));
|
||||
? errhint("ALTER TABLE ... MERGE PARTITIONS can only merge partitions that don't have sub-partitions.")
|
||||
: errhint("ALTER TABLE ... SPLIT PARTITION can only split partitions that don't have sub-partitions."));
|
||||
|
||||
if (get_partition_parent(partRelOid, false) != RelationGetRelid(rel))
|
||||
ereport(ERROR,
|
||||
|
|
@ -3558,8 +3558,8 @@ checkPartition(Relation rel, Oid partRelOid, bool isMerge)
|
|||
errmsg("relation \"%s\" is not a partition of relation \"%s\"",
|
||||
RelationGetRelationName(partRel), RelationGetRelationName(rel)),
|
||||
isMerge
|
||||
? errhint("ALTER TABLE ... MERGE PARTITIONS can only merge partitions don't have sub-partitions.")
|
||||
: errhint("ALTER TABLE ... SPLIT PARTITION can only split partitions don't have sub-partitions."));
|
||||
? errhint("ALTER TABLE ... MERGE PARTITIONS can only merge partitions that don't have sub-partitions.")
|
||||
: errhint("ALTER TABLE ... SPLIT PARTITION can only split partitions that don't have sub-partitions."));
|
||||
|
||||
table_close(partRel, NoLock);
|
||||
}
|
||||
|
|
@ -3622,7 +3622,7 @@ transformPartitionCmdForSplit(CreateStmtContext *cxt, PartitionCmd *partcmd)
|
|||
if (default_index != -1)
|
||||
ereport(ERROR,
|
||||
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
|
||||
errmsg("DEFAULT partition should be one"),
|
||||
errmsg("cannot specify more than one DEFAULT partition"),
|
||||
parser_errposition(cxt->pstate, sps->name->location));
|
||||
|
||||
default_index = foreach_current_index(sps);
|
||||
|
|
@ -3649,10 +3649,9 @@ transformPartitionCmdForSplit(CreateStmtContext *cxt, PartitionCmd *partcmd)
|
|||
if (isSplitPartDefault && default_index == -1)
|
||||
ereport(ERROR,
|
||||
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
|
||||
errmsg("can not split DEFAULT partition \"%s\"",
|
||||
errmsg("cannot split DEFAULT partition \"%s\"",
|
||||
get_rel_name(splitPartOid)),
|
||||
errhint("To split DEFAULT partition one of the new partition must be DEFAULT."),
|
||||
parser_errposition(cxt->pstate, ((SinglePartitionSpec *) linitial(splitlist))->name->location));
|
||||
errhint("To split a DEFAULT partition, one of the new partitions must be DEFAULT."));
|
||||
|
||||
/*
|
||||
* If the partition being split is not the DEFAULT partition, but the
|
||||
|
|
@ -3666,10 +3665,10 @@ transformPartitionCmdForSplit(CreateStmtContext *cxt, PartitionCmd *partcmd)
|
|||
|
||||
ereport(ERROR,
|
||||
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
|
||||
errmsg("can not split non-DEFAULT partition \"%s\"",
|
||||
errmsg("cannot split non-DEFAULT partition \"%s\"",
|
||||
get_rel_name(splitPartOid)),
|
||||
errmsg("new partition cannot be DEFAULT because DEFAULT partition \"%s\" already exists",
|
||||
get_rel_name(defaultPartOid)),
|
||||
errdetail("New partition cannot be DEFAULT because DEFAULT partition \"%s\" already exists.",
|
||||
get_rel_name(defaultPartOid)),
|
||||
parser_errposition(cxt->pstate, spsDef->name->location));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5030,18 +5030,18 @@ check_two_partitions_bounds_range(Relation parent,
|
|||
if (is_merge)
|
||||
ereport(ERROR,
|
||||
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
|
||||
errmsg("can not merge partition \"%s\" together with partition \"%s\"",
|
||||
errmsg("cannot merge partition \"%s\" together with partition \"%s\"",
|
||||
second_name->relname, first_name->relname),
|
||||
errdetail("lower bound of partition \"%s\" is not equal to the upper bound of partition \"%s\"",
|
||||
errdetail("The lower bound of partition \"%s\" is not equal to the upper bound of partition \"%s\".",
|
||||
second_name->relname, first_name->relname),
|
||||
errhint("ALTER TABLE ... MERGE PARTITIONS requires the partition bounds to be adjacent."),
|
||||
parser_errposition(pstate, datum->location));
|
||||
else
|
||||
ereport(ERROR,
|
||||
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
|
||||
errmsg("can not split to partition \"%s\" together with partition \"%s\"",
|
||||
errmsg("cannot split to partition \"%s\" together with partition \"%s\"",
|
||||
second_name->relname, first_name->relname),
|
||||
errdetail("lower bound of partition \"%s\" is not equal to the upper bound of partition \"%s\"",
|
||||
errdetail("The lower bound of partition \"%s\" is not equal to the upper bound of partition \"%s\".",
|
||||
second_name->relname, first_name->relname),
|
||||
errhint("ALTER TABLE ... SPLIT PARTITION requires the partition bounds to be adjacent."),
|
||||
parser_errposition(pstate, datum->location));
|
||||
|
|
@ -5525,7 +5525,7 @@ check_partition_bounds_for_split_list(Relation parent, char *relname,
|
|||
else
|
||||
ereport(ERROR,
|
||||
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
|
||||
errmsg("new partition \"%s\" cannot have this value because split partition \"%s\" does not have",
|
||||
errmsg("new partition \"%s\" cannot have this value because split partition \"%s\" does not have it",
|
||||
relname,
|
||||
get_rel_name(splitPartOid)),
|
||||
parser_errposition(pstate, overlap_location));
|
||||
|
|
@ -5542,7 +5542,7 @@ check_partition_bounds_for_split_list(Relation parent, char *relname,
|
|||
else
|
||||
ereport(ERROR,
|
||||
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
|
||||
errmsg("new partition \"%s\" cannot have NULL value because split partition \"%s\" does not have",
|
||||
errmsg("new partition \"%s\" cannot have NULL value because split partition \"%s\" does not have it",
|
||||
relname,
|
||||
get_rel_name(splitPartOid)),
|
||||
parser_errposition(pstate, overlap_location));
|
||||
|
|
@ -5650,7 +5650,7 @@ check_parent_values_in_new_partitions(Relation parent,
|
|||
if (!found)
|
||||
ereport(ERROR,
|
||||
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
|
||||
errmsg("new partitions combined partition bounds do not contain value (%s) but split partition \"%s\" does",
|
||||
errmsg("new partitions' combined partition bounds do not contain value (%s) but split partition \"%s\" does",
|
||||
"NULL",
|
||||
get_rel_name(partOid)),
|
||||
errhint("%s require combined bounds of new partitions must exactly match the bound of the split partition.",
|
||||
|
|
@ -5693,7 +5693,7 @@ check_parent_values_in_new_partitions(Relation parent,
|
|||
|
||||
ereport(ERROR,
|
||||
errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
|
||||
errmsg("new partitions combined partition bounds do not contain value (%s) but split partition \"%s\" does",
|
||||
errmsg("new partitions' combined partition bounds do not contain value (%s) but split partition \"%s\" does",
|
||||
deparse_expression((Node *) notFoundVal, NIL, false, false),
|
||||
get_rel_name(partOid)),
|
||||
errhint("%s require combined bounds of new partitions must exactly match the bound of the split partition.",
|
||||
|
|
|
|||
|
|
@ -29,20 +29,20 @@ LINE 1: ...e MERGE PARTITIONS (sales_feb2022, sales_mar2022, sales_feb2...
|
|||
-- ERROR: "sales_apr2022" is not a table
|
||||
ALTER TABLE sales_range MERGE PARTITIONS (sales_feb2022, sales_mar2022, sales_apr2022) INTO sales_feb_mar_apr2022;
|
||||
ERROR: "sales_apr2022" is not a table
|
||||
HINT: ALTER TABLE ... MERGE PARTITIONS can only merge partitions don't have sub-partitions.
|
||||
HINT: ALTER TABLE ... MERGE PARTITIONS can only merge partitions that don't have sub-partitions.
|
||||
-- ERROR: can not merge partition "sales_mar2022" together with partition "sales_jan2022"
|
||||
-- DETAIL: lower bound of partition "sales_mar2022" is not equal to the upper bound of partition "sales_jan2022"
|
||||
-- (space between sections sales_jan2022 and sales_mar2022)
|
||||
ALTER TABLE sales_range MERGE PARTITIONS (sales_jan2022, sales_mar2022) INTO sales_jan_mar2022;
|
||||
ERROR: can not merge partition "sales_mar2022" together with partition "sales_jan2022"
|
||||
DETAIL: lower bound of partition "sales_mar2022" is not equal to the upper bound of partition "sales_jan2022"
|
||||
ERROR: cannot merge partition "sales_mar2022" together with partition "sales_jan2022"
|
||||
DETAIL: The lower bound of partition "sales_mar2022" is not equal to the upper bound of partition "sales_jan2022".
|
||||
HINT: ALTER TABLE ... MERGE PARTITIONS requires the partition bounds to be adjacent.
|
||||
-- ERROR: can not merge partition "sales_jan2022" together with partition "sales_dec2021"
|
||||
-- DETAIL: lower bound of partition "sales_jan2022" is not equal to the upper bound of partition "sales_dec2021"
|
||||
-- (space between sections sales_dec2021 and sales_jan2022)
|
||||
ALTER TABLE sales_range MERGE PARTITIONS (sales_dec2021, sales_jan2022, sales_feb2022) INTO sales_dec_jan_feb2022;
|
||||
ERROR: can not merge partition "sales_jan2022" together with partition "sales_dec2021"
|
||||
DETAIL: lower bound of partition "sales_jan2022" is not equal to the upper bound of partition "sales_dec2021"
|
||||
ERROR: cannot merge partition "sales_jan2022" together with partition "sales_dec2021"
|
||||
DETAIL: The lower bound of partition "sales_jan2022" is not equal to the upper bound of partition "sales_dec2021".
|
||||
HINT: ALTER TABLE ... MERGE PARTITIONS requires the partition bounds to be adjacent.
|
||||
-- ERROR: partition with name "sales_feb2022" is already used
|
||||
ALTER TABLE sales_range MERGE PARTITIONS (sales_feb2022, sales_mar2022, partitions_merge_schema.sales_feb2022) INTO sales_feb_mar_apr2022;
|
||||
|
|
@ -483,15 +483,15 @@ CREATE TABLE sales_external2 (vch VARCHAR(5));
|
|||
-- ERROR: "sales_external" is not a partition of partitioned table "sales_list"
|
||||
ALTER TABLE sales_list MERGE PARTITIONS (sales_west, sales_east, sales_external) INTO sales_all;
|
||||
ERROR: "sales_external" is not a partition of partitioned table "sales_list"
|
||||
HINT: ALTER TABLE ... MERGE PARTITIONS can only merge partitions don't have sub-partitions.
|
||||
HINT: ALTER TABLE ... MERGE PARTITIONS can only merge partitions that don't have sub-partitions.
|
||||
-- ERROR: "sales_external2" is not a partition of partitioned table "sales_list"
|
||||
ALTER TABLE sales_list MERGE PARTITIONS (sales_west, sales_east, sales_external2) INTO sales_all;
|
||||
ERROR: "sales_external2" is not a partition of partitioned table "sales_list"
|
||||
HINT: ALTER TABLE ... MERGE PARTITIONS can only merge partitions don't have sub-partitions.
|
||||
HINT: ALTER TABLE ... MERGE PARTITIONS can only merge partitions that don't have sub-partitions.
|
||||
-- ERROR: relation "sales_nord2" is not a partition of relation "sales_list"
|
||||
ALTER TABLE sales_list MERGE PARTITIONS (sales_west, sales_nord2, sales_east) INTO sales_all;
|
||||
ERROR: relation "sales_nord2" is not a partition of relation "sales_list"
|
||||
HINT: ALTER TABLE ... MERGE PARTITIONS can only merge partitions don't have sub-partitions.
|
||||
HINT: ALTER TABLE ... MERGE PARTITIONS can only merge partitions that don't have sub-partitions.
|
||||
DROP TABLE sales_external2;
|
||||
DROP TABLE sales_external;
|
||||
DROP TABLE sales_list2;
|
||||
|
|
@ -633,11 +633,11 @@ CREATE TABLE t3 (i int, t text);
|
|||
-- ERROR: relation "t1p1" is not a partition of relation "t2"
|
||||
ALTER TABLE t2 MERGE PARTITIONS (t1p1, t2pa) INTO t2p;
|
||||
ERROR: relation "t1p1" is not a partition of relation "t2"
|
||||
HINT: ALTER TABLE ... MERGE PARTITIONS can only merge partitions don't have sub-partitions.
|
||||
HINT: ALTER TABLE ... MERGE PARTITIONS can only merge partitions that don't have sub-partitions.
|
||||
-- ERROR: "t3" is not a partition of partitioned table "t2"
|
||||
ALTER TABLE t2 MERGE PARTITIONS (t2pa, t3) INTO t2p;
|
||||
ERROR: "t3" is not a partition of partitioned table "t2"
|
||||
HINT: ALTER TABLE ... MERGE PARTITIONS can only merge partitions don't have sub-partitions.
|
||||
HINT: ALTER TABLE ... MERGE PARTITIONS can only merge partitions that don't have sub-partitions.
|
||||
DROP TABLE t3;
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
|
|
|
|||
|
|
@ -106,10 +106,10 @@ ALTER TABLE sales_range SPLIT PARTITION sales_feb_mar_apr2022 INTO
|
|||
(PARTITION sales_feb2022 FOR VALUES FROM ('2022-02-01') TO ('2022-03-01'),
|
||||
PARTITION sales_mar2022 FOR VALUES FROM ('2022-02-01') TO ('2022-04-01'),
|
||||
PARTITION sales_apr2022 FOR VALUES FROM ('2022-04-01') TO ('2022-05-01'));
|
||||
ERROR: can not split to partition "sales_mar2022" together with partition "sales_feb2022"
|
||||
ERROR: cannot split to partition "sales_mar2022" together with partition "sales_feb2022"
|
||||
LINE 3: PARTITION sales_mar2022 FOR VALUES FROM ('2022-02-01') TO...
|
||||
^
|
||||
DETAIL: lower bound of partition "sales_mar2022" is not equal to the upper bound of partition "sales_feb2022"
|
||||
DETAIL: The lower bound of partition "sales_mar2022" is not equal to the upper bound of partition "sales_feb2022".
|
||||
HINT: ALTER TABLE ... SPLIT PARTITION requires the partition bounds to be adjacent.
|
||||
-- Tests for spaces between partitions, them should be executed without DEFAULT partition
|
||||
ALTER TABLE sales_range DETACH PARTITION sales_others;
|
||||
|
|
@ -467,10 +467,10 @@ ALTER TABLE sales_range SPLIT PARTITION sales_others INTO
|
|||
PARTITION sales_error FOR VALUES FROM ('2021-12-30') TO ('2022-02-01'),
|
||||
PARTITION sales_feb2022 FOR VALUES FROM ('2022-02-01') TO ('2022-03-01'),
|
||||
PARTITION sales_others DEFAULT);
|
||||
ERROR: can not split to partition "sales_error" together with partition "sales_dec2021"
|
||||
ERROR: cannot split to partition "sales_error" together with partition "sales_dec2021"
|
||||
LINE 3: PARTITION sales_error FOR VALUES FROM ('2021-12-30') TO (...
|
||||
^
|
||||
DETAIL: lower bound of partition "sales_error" is not equal to the upper bound of partition "sales_dec2021"
|
||||
DETAIL: The lower bound of partition "sales_error" is not equal to the upper bound of partition "sales_dec2021".
|
||||
HINT: ALTER TABLE ... SPLIT PARTITION requires the partition bounds to be adjacent.
|
||||
-- sales_error intersects with sales_feb2022 (upper bound)
|
||||
-- ERROR: can not split to partition "sales_feb2022" together with partition "sales_error"
|
||||
|
|
@ -479,10 +479,10 @@ ALTER TABLE sales_range SPLIT PARTITION sales_others INTO
|
|||
PARTITION sales_error FOR VALUES FROM ('2022-01-01') TO ('2022-02-02'),
|
||||
PARTITION sales_feb2022 FOR VALUES FROM ('2022-02-01') TO ('2022-03-01'),
|
||||
PARTITION sales_others DEFAULT);
|
||||
ERROR: can not split to partition "sales_feb2022" together with partition "sales_error"
|
||||
ERROR: cannot split to partition "sales_feb2022" together with partition "sales_error"
|
||||
LINE 4: PARTITION sales_feb2022 FOR VALUES FROM ('2022-02-01') TO...
|
||||
^
|
||||
DETAIL: lower bound of partition "sales_feb2022" is not equal to the upper bound of partition "sales_error"
|
||||
DETAIL: The lower bound of partition "sales_feb2022" is not equal to the upper bound of partition "sales_error".
|
||||
HINT: ALTER TABLE ... SPLIT PARTITION requires the partition bounds to be adjacent.
|
||||
-- sales_error intersects with sales_dec2021 (inside bound)
|
||||
-- ERROR: can not split to partition "sales_error" together with partition "sales_dec2021"
|
||||
|
|
@ -491,10 +491,10 @@ ALTER TABLE sales_range SPLIT PARTITION sales_others INTO
|
|||
PARTITION sales_error FOR VALUES FROM ('2021-12-10') TO ('2021-12-20'),
|
||||
PARTITION sales_feb2022 FOR VALUES FROM ('2022-02-01') TO ('2022-03-01'),
|
||||
PARTITION sales_others DEFAULT);
|
||||
ERROR: can not split to partition "sales_error" together with partition "sales_dec2021"
|
||||
ERROR: cannot split to partition "sales_error" together with partition "sales_dec2021"
|
||||
LINE 3: PARTITION sales_error FOR VALUES FROM ('2021-12-10') TO (...
|
||||
^
|
||||
DETAIL: lower bound of partition "sales_error" is not equal to the upper bound of partition "sales_dec2021"
|
||||
DETAIL: The lower bound of partition "sales_error" is not equal to the upper bound of partition "sales_dec2021".
|
||||
HINT: ALTER TABLE ... SPLIT PARTITION requires the partition bounds to be adjacent.
|
||||
-- sales_error intersects with sales_dec2021 (exactly the same bounds)
|
||||
-- ERROR: can not split to partition "sales_error" together with partition "sales_dec2021"
|
||||
|
|
@ -503,10 +503,10 @@ ALTER TABLE sales_range SPLIT PARTITION sales_others INTO
|
|||
PARTITION sales_error FOR VALUES FROM ('2021-12-01') TO ('2022-01-01'),
|
||||
PARTITION sales_feb2022 FOR VALUES FROM ('2022-02-01') TO ('2022-03-01'),
|
||||
PARTITION sales_others DEFAULT);
|
||||
ERROR: can not split to partition "sales_error" together with partition "sales_dec2021"
|
||||
ERROR: cannot split to partition "sales_error" together with partition "sales_dec2021"
|
||||
LINE 3: PARTITION sales_error FOR VALUES FROM ('2021-12-01') TO (...
|
||||
^
|
||||
DETAIL: lower bound of partition "sales_error" is not equal to the upper bound of partition "sales_dec2021"
|
||||
DETAIL: The lower bound of partition "sales_error" is not equal to the upper bound of partition "sales_dec2021".
|
||||
HINT: ALTER TABLE ... SPLIT PARTITION requires the partition bounds to be adjacent.
|
||||
-- ERROR: can not split DEFAULT partition "sales_others"
|
||||
-- HINT: To split DEFAULT partition one of the new partition must be DEFAULT.
|
||||
|
|
@ -514,10 +514,8 @@ ALTER TABLE sales_range SPLIT PARTITION sales_others INTO
|
|||
(PARTITION sales_dec2021 FOR VALUES FROM ('2021-12-01') TO ('2022-01-01'),
|
||||
PARTITION sales_jan2022 FOR VALUES FROM ('2022-01-01') TO ('2022-02-01'),
|
||||
PARTITION sales_feb2022 FOR VALUES FROM ('2022-02-01') TO ('2022-03-01'));
|
||||
ERROR: can not split DEFAULT partition "sales_others"
|
||||
LINE 2: (PARTITION sales_dec2021 FOR VALUES FROM ('2021-12-01') TO...
|
||||
^
|
||||
HINT: To split DEFAULT partition one of the new partition must be DEFAULT.
|
||||
ERROR: cannot split DEFAULT partition "sales_others"
|
||||
HINT: To split a DEFAULT partition, one of the new partitions must be DEFAULT.
|
||||
-- no error: bounds of sales_noerror are between sales_dec2021 and sales_feb2022
|
||||
ALTER TABLE sales_range SPLIT PARTITION sales_others INTO
|
||||
(PARTITION sales_dec2021 FOR VALUES FROM ('2021-12-01') TO ('2022-01-01'),
|
||||
|
|
@ -878,7 +876,7 @@ ALTER TABLE sales_list SPLIT PARTITION sales_all INTO
|
|||
(PARTITION sales_west FOR VALUES IN ('Lisbon', 'New York', 'Madrid', NULL),
|
||||
PARTITION sales_east FOR VALUES IN ('Beijing', 'Delhi', 'Vladivostok'),
|
||||
PARTITION sales_central FOR VALUES IN ('Warsaw', 'Berlin', 'Kyiv'));
|
||||
ERROR: new partition "sales_west" cannot have NULL value because split partition "sales_all" does not have
|
||||
ERROR: new partition "sales_west" cannot have NULL value because split partition "sales_all" does not have it
|
||||
LINE 2: ...s_west FOR VALUES IN ('Lisbon', 'New York', 'Madrid', NULL),
|
||||
^
|
||||
-- ERROR: new partition "sales_west" cannot have this value because split partition "sales_all" does not have
|
||||
|
|
@ -886,7 +884,7 @@ ALTER TABLE sales_list SPLIT PARTITION sales_all INTO
|
|||
(PARTITION sales_west FOR VALUES IN ('Lisbon', 'New York', 'Madrid', 'Melbourne'),
|
||||
PARTITION sales_east FOR VALUES IN ('Beijing', 'Delhi', 'Vladivostok'),
|
||||
PARTITION sales_central FOR VALUES IN ('Warsaw', 'Berlin', 'Kyiv'));
|
||||
ERROR: new partition "sales_west" cannot have this value because split partition "sales_all" does not have
|
||||
ERROR: new partition "sales_west" cannot have this value because split partition "sales_all" does not have it
|
||||
LINE 2: ...st FOR VALUES IN ('Lisbon', 'New York', 'Madrid', 'Melbourne...
|
||||
^
|
||||
-- ERROR: new partition cannot be DEFAULT because DEFAULT partition "sales_others" already exists
|
||||
|
|
@ -895,9 +893,10 @@ ALTER TABLE sales_list SPLIT PARTITION sales_all INTO
|
|||
PARTITION sales_east FOR VALUES IN ('Beijing', 'Delhi', 'Vladivostok'),
|
||||
PARTITION sales_central FOR VALUES IN ('Warsaw', 'Berlin', 'Kyiv'),
|
||||
PARTITION sales_others2 DEFAULT);
|
||||
ERROR: new partition cannot be DEFAULT because DEFAULT partition "sales_others" already exists
|
||||
ERROR: cannot split non-DEFAULT partition "sales_all"
|
||||
LINE 5: PARTITION sales_others2 DEFAULT);
|
||||
^
|
||||
DETAIL: New partition cannot be DEFAULT because DEFAULT partition "sales_others" already exists.
|
||||
DROP TABLE sales_list;
|
||||
-- Test for non-symbolic comparison of values (numeric values '0' and '0.0' are equal).
|
||||
CREATE TABLE t (a numeric) PARTITION BY LIST (a);
|
||||
|
|
@ -924,7 +923,7 @@ ALTER TABLE sales_list SPLIT PARTITION sales_all INTO
|
|||
(PARTITION sales_west FOR VALUES IN ('Lisbon', 'New York', 'Madrid'),
|
||||
PARTITION sales_east FOR VALUES IN ('Beijing', 'Delhi', 'Vladivostok'),
|
||||
PARTITION sales_central FOR VALUES IN ('Warsaw', 'Berlin', 'Kyiv'));
|
||||
ERROR: new partitions combined partition bounds do not contain value (NULL) but split partition "sales_all" does
|
||||
ERROR: new partitions' combined partition bounds do not contain value (NULL) but split partition "sales_all" does
|
||||
HINT: ALTER TABLE ... SPLIT PARTITION require combined bounds of new partitions must exactly match the bound of the split partition.
|
||||
-- ERROR: new partitions combined partition bounds do not contain value ('Kyiv'::character varying(20)) but split partition "sales_all" does
|
||||
-- HINT: ALTER TABLE ... SPLIT PARTITION require combined bounds of new partitions must exactly match the bound of the split partition.
|
||||
|
|
@ -932,7 +931,7 @@ ALTER TABLE sales_list SPLIT PARTITION sales_all INTO
|
|||
(PARTITION sales_west FOR VALUES IN ('Lisbon', 'New York', 'Madrid'),
|
||||
PARTITION sales_east FOR VALUES IN ('Beijing', 'Delhi', 'Vladivostok'),
|
||||
PARTITION sales_central FOR VALUES IN ('Warsaw', 'Berlin', NULL));
|
||||
ERROR: new partitions combined partition bounds do not contain value ('Kyiv'::character varying(20)) but split partition "sales_all" does
|
||||
ERROR: new partitions' combined partition bounds do not contain value ('Kyiv'::character varying(20)) but split partition "sales_all" does
|
||||
HINT: ALTER TABLE ... SPLIT PARTITION require combined bounds of new partitions must exactly match the bound of the split partition.
|
||||
-- ERROR DEFAULT partition should be one
|
||||
ALTER TABLE sales_list SPLIT PARTITION sales_all INTO
|
||||
|
|
@ -941,7 +940,7 @@ ALTER TABLE sales_list SPLIT PARTITION sales_all INTO
|
|||
PARTITION sales_central FOR VALUES IN ('Warsaw', 'Berlin', 'Kyiv'),
|
||||
PARTITION sales_others DEFAULT,
|
||||
PARTITION sales_others2 DEFAULT);
|
||||
ERROR: DEFAULT partition should be one
|
||||
ERROR: cannot specify more than one DEFAULT partition
|
||||
LINE 6: PARTITION sales_others2 DEFAULT);
|
||||
^
|
||||
DROP TABLE sales_list;
|
||||
|
|
@ -1207,7 +1206,7 @@ ALTER TABLE t2 SPLIT PARTITION t1pa INTO
|
|||
(PARTITION t2a FOR VALUES FROM ('A') TO ('B'),
|
||||
PARTITION t2b FOR VALUES FROM ('B') TO ('C'));
|
||||
ERROR: relation "t1pa" is not a partition of relation "t2"
|
||||
HINT: ALTER TABLE ... SPLIT PARTITION can only split partitions don't have sub-partitions.
|
||||
HINT: ALTER TABLE ... SPLIT PARTITION can only split partitions that don't have sub-partitions.
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
--
|
||||
|
|
|
|||
Loading…
Reference in a new issue