Skip to content

Commit f53ceae

Browse files
committed
Avoid using ambiguous word "positive" in error message.
There are two identical error messages about valid value of modulus for hash partition, in PostgreSQL source code. Commit 0e1275f improved only one of them so that ambiguous word "positive" was avoided there, and forgot to improve the other. This commit improves the other. Which would reduce translator burden. Back-pach to v11 where the error message exists. Author: Kyotaro Horiguchi Reviewed-by: Fujii Masao Discussion: https://postgr.es/m/20210819.170315.1413060634876301811.horikyota.ntt@gmail.com
1 parent 69b93a0 commit f53ceae

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/backend/parser/parse_utilcmd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3897,7 +3897,7 @@ transformPartitionBound(ParseState *pstate, Relation parent,
38973897
if (spec->modulus <= 0)
38983898
ereport(ERROR,
38993899
(errcode(ERRCODE_INVALID_TABLE_DEFINITION),
3900-
errmsg("modulus for hash partition must be a positive integer")));
3900+
errmsg("modulus for hash partition must be an integer value greater than zero")));
39013901

39023902
Assert(spec->remainder >= 0);
39033903

src/test/regress/expected/alter_table.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3942,7 +3942,7 @@ ALTER TABLE hash_parted ATTACH PARTITION hpart_5 FOR VALUES WITH (MODULUS 4, REM
39423942
-- check that the table being attach is with valid modulus and remainder value
39433943
CREATE TABLE fail_part(LIKE hash_parted);
39443944
ALTER TABLE hash_parted ATTACH PARTITION fail_part FOR VALUES WITH (MODULUS 0, REMAINDER 1);
3945-
ERROR: modulus for hash partition must be a positive integer
3945+
ERROR: modulus for hash partition must be an integer value greater than zero
39463946
ALTER TABLE hash_parted ATTACH PARTITION fail_part FOR VALUES WITH (MODULUS 8, REMAINDER 8);
39473947
ERROR: remainder for hash partition must be less than modulus
39483948
ALTER TABLE hash_parted ATTACH PARTITION fail_part FOR VALUES WITH (MODULUS 3, REMAINDER 2);

src/test/regress/expected/create_table.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ CREATE TABLE fail_part PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 2, REM
845845
ERROR: partition "fail_part" would overlap partition "h2part_4"
846846
-- modulus must be greater than zero
847847
CREATE TABLE fail_part PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 0, REMAINDER 1);
848-
ERROR: modulus for hash partition must be a positive integer
848+
ERROR: modulus for hash partition must be an integer value greater than zero
849849
-- remainder must be greater than or equal to zero and less than modulus
850850
CREATE TABLE fail_part PARTITION OF hash_parted2 FOR VALUES WITH (MODULUS 8, REMAINDER 8);
851851
ERROR: remainder for hash partition must be less than modulus

0 commit comments

Comments
 (0)