From e8bdea58f960eac669ebac01dc3865606dd7b453 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Thu, 6 Jun 2019 12:18:14 -0400 Subject: [PATCH] Fix message style Mark one message not for translation, and prefer "cannot" over "may not", per commentary from Robert Haas. Discussion: https://postgr.es/m/20190430145813.GA29872@alvherre.pgsql --- src/backend/access/heap/heapam.c | 2 +- src/backend/access/table/tableamapi.c | 3 ++- src/test/regress/expected/create_am.out | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c index 419da8784a..bf82304b0f 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -1301,7 +1301,7 @@ heap_getnext(TableScanDesc sscan, ScanDirection direction) if (unlikely(sscan->rs_rd->rd_tableam != GetHeapamTableAmRoutine())) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("only heap AM is supported"))); + errmsg_internal("only heap AM is supported"))); /* Note: no locking manipulations needed */ diff --git a/src/backend/access/table/tableamapi.c b/src/backend/access/table/tableamapi.c index 32877e7674..34e6a4f20d 100644 --- a/src/backend/access/table/tableamapi.c +++ b/src/backend/access/table/tableamapi.c @@ -106,7 +106,8 @@ check_default_table_access_method(char **newval, void **extra, GucSource source) { if (**newval == '\0') { - GUC_check_errdetail("default_table_access_method may not be empty."); + GUC_check_errdetail("%s cannot be empty.", + "default_table_access_method"); return false; } diff --git a/src/test/regress/expected/create_am.out b/src/test/regress/expected/create_am.out index 352959b751..f6d5c97cde 100644 --- a/src/test/regress/expected/create_am.out +++ b/src/test/regress/expected/create_am.out @@ -110,7 +110,7 @@ NOTICE: drop cascades to index grect2ind2 -- prevent empty values SET default_table_access_method = ''; ERROR: invalid value for parameter "default_table_access_method": "" -DETAIL: default_table_access_method may not be empty. +DETAIL: default_table_access_method cannot be empty. -- prevent nonexistant values SET default_table_access_method = 'I do not exist AM'; ERROR: invalid value for parameter "default_table_access_method": "I do not exist AM" -- 2.40.0