From 06f04b6dc41354d1eada7b68bab339c908fc97eb Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 5 Jul 2011 00:01:35 +0300 Subject: [PATCH] Message style tweaks --- src/backend/commands/tablecmds.c | 3 ++- src/backend/parser/parse_utilcmd.c | 2 +- src/backend/port/win32/crashdump.c | 10 +++++----- src/backend/storage/lmgr/predicate.c | 2 +- src/backend/utils/adt/varlena.c | 2 +- src/backend/utils/misc/guc.c | 8 ++++---- src/test/regress/expected/foreign_data.out | 4 ++-- src/test/regress/expected/text.out | 2 +- src/test/regress/sql/foreign_data.sql | 2 +- 9 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 029d33a223..142419f2cc 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -6751,7 +6751,8 @@ ATPrepAlterColumnType(List **wqueue, else if (transform) ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE), - errmsg("ALTER TYPE USING is only supported on plain tables"))); + errmsg("\"%s\" is not a table", + RelationGetRelationName(rel)))); if (tab->relkind == RELKIND_COMPOSITE_TYPE || tab->relkind == RELKIND_FOREIGN_TABLE) diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index d53286cd2a..c9839ba92c 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -1524,7 +1524,7 @@ transformIndexConstraint(Constraint *constraint, CreateStmtContext *cxt) if (index_rel->rd_rel->relam != get_am_oid(DEFAULT_INDEX_TYPE, false)) ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE), - errmsg("index \"%s\" is not a b-tree", index_name), + errmsg("index \"%s\" is not a btree", index_name), parser_errposition(cxt->pstate, constraint->location))); /* Must get indclass the hard way */ diff --git a/src/backend/port/win32/crashdump.c b/src/backend/port/win32/crashdump.c index 119dd076ca..b905206a29 100644 --- a/src/backend/port/win32/crashdump.c +++ b/src/backend/port/win32/crashdump.c @@ -105,7 +105,7 @@ crashDumpHandler(struct _EXCEPTION_POINTERS * pExceptionInfo) hDll = LoadLibrary("dbghelp.dll"); if (hDll == NULL) { - write_stderr("could not load dbghelp.dll, cannot write crashdump\n"); + write_stderr("could not load dbghelp.dll, cannot write crash dump\n"); return EXCEPTION_CONTINUE_SEARCH; } @@ -113,7 +113,7 @@ crashDumpHandler(struct _EXCEPTION_POINTERS * pExceptionInfo) if (pDump == NULL) { - write_stderr("could not load required functions in dbghelp.dll, cannot write crashdump\n"); + write_stderr("could not load required functions in dbghelp.dll, cannot write crash dump\n"); return EXCEPTION_CONTINUE_SEARCH; } @@ -144,16 +144,16 @@ crashDumpHandler(struct _EXCEPTION_POINTERS * pExceptionInfo) NULL); if (dumpFile == INVALID_HANDLE_VALUE) { - write_stderr("could not open crash dump file %s for writing: error code %u\n", + write_stderr("could not open crash dump file \"%s\" for writing: error code %u\n", dumpPath, (unsigned int) GetLastError()); return EXCEPTION_CONTINUE_SEARCH; } if ((*pDump) (selfProcHandle, selfPid, dumpFile, dumpType, &ExInfo, NULL, NULL)) - write_stderr("wrote crash dump to %s\n", dumpPath); + write_stderr("wrote crash dump to file \"%s\"\n", dumpPath); else - write_stderr("could not write crash dump to %s: error code %08x\n", + write_stderr("could not write crash dump to file \"%s\": error code %08x\n", dumpPath, (unsigned int) GetLastError()); CloseHandle(dumpFile); diff --git a/src/backend/storage/lmgr/predicate.c b/src/backend/storage/lmgr/predicate.c index ce92dfcf17..1707a74664 100644 --- a/src/backend/storage/lmgr/predicate.c +++ b/src/backend/storage/lmgr/predicate.c @@ -882,7 +882,7 @@ OldSerXidAdd(TransactionId xid, SerCommitSeqNo minConflictCommitSeqNo) oldSerXidControl->warningIssued = true; ereport(WARNING, (errmsg("memory for serializable conflict tracking is nearly exhausted"), - errhint("There may be an idle transaction or a forgotten prepared transaction causing this."))); + errhint("There might be an idle transaction or a forgotten prepared transaction causing this."))); } } diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c index 9acbc2d4e5..d1113ed5d3 100644 --- a/src/backend/utils/adt/varlena.c +++ b/src/backend/utils/adt/varlena.c @@ -3937,7 +3937,7 @@ text_format_string_conversion(StringInfo buf, char conversion, else if (conversion == 'I') ereport(ERROR, (errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED), - errmsg("NULL cannot be escaped as an SQL identifier"))); + errmsg("null values cannot be formatted as an SQL identifier"))); return; } diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 1c6f197748..5fe469262d 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -887,7 +887,7 @@ static struct config_bool ConfigureNamesBool[] = }, { {"restart_after_crash", PGC_SIGHUP, ERROR_HANDLING_OPTIONS, - gettext_noop("Reinitialize after backend crash."), + gettext_noop("Reinitialize server after backend crash."), NULL }, &restart_after_crash, @@ -1378,7 +1378,7 @@ static struct config_bool ConfigureNamesBool[] = { {"hot_standby_feedback", PGC_SIGHUP, WAL_STANDBY_SERVERS, - gettext_noop("Allows feedback from a hot standby primary that will avoid query conflicts."), + gettext_noop("Allows feedback from a hot standby to the primary that will avoid query conflicts."), NULL }, &hot_standby_feedback, @@ -1567,7 +1567,7 @@ static struct config_int ConfigureNamesInt[] = { {"wal_receiver_status_interval", PGC_SIGHUP, WAL_STANDBY_SERVERS, - gettext_noop("Sets the maximum interval between WAL receiver status reports to the master."), + gettext_noop("Sets the maximum interval between WAL receiver status reports to the primary."), NULL, GUC_UNIT_S }, @@ -2965,7 +2965,7 @@ static struct config_string ConfigureNamesString[] = { {"synchronous_standby_names", PGC_SIGHUP, WAL_REPLICATION, - gettext_noop("List of potential standby names to synchronize with."), + gettext_noop("List of names of potential synchronous standbys."), NULL, GUC_LIST_INPUT }, diff --git a/src/test/regress/expected/foreign_data.out b/src/test/regress/expected/foreign_data.out index def850ba89..2b3eddfc8b 100644 --- a/src/test/regress/expected/foreign_data.out +++ b/src/test/regress/expected/foreign_data.out @@ -694,8 +694,8 @@ ALTER FOREIGN TABLE ft1 ALTER COLUMN c5 DROP DEFAULT; -- ERROR ERROR: "ft1" is not a table or view ALTER FOREIGN TABLE ft1 ALTER COLUMN c6 SET NOT NULL; ALTER FOREIGN TABLE ft1 ALTER COLUMN c7 DROP NOT NULL; -ALTER FOREIGN TABLE ft1 ALTER COLUMN c8 TYPE char(10) using '0'; -- ERROR -ERROR: ALTER TYPE USING is only supported on plain tables +ALTER FOREIGN TABLE ft1 ALTER COLUMN c8 TYPE char(10) USING '0'; -- ERROR +ERROR: "ft1" is not a table ALTER FOREIGN TABLE ft1 ALTER COLUMN c8 TYPE char(10); ALTER FOREIGN TABLE ft1 ALTER COLUMN c8 SET DATA TYPE text; -- can't change the column type if it's used elsewhere diff --git a/src/test/regress/expected/text.out b/src/test/regress/expected/text.out index b84e8544d5..f5cb5e2509 100644 --- a/src/test/regress/expected/text.out +++ b/src/test/regress/expected/text.out @@ -203,7 +203,7 @@ select format('INSERT INTO %I VALUES(%L,%L)', 'mytab', NULL, 'Hello'); -- should fail, sql identifier cannot be NULL select format('INSERT INTO %I VALUES(%L,%L)', NULL, 10, 'Hello'); -ERROR: NULL cannot be escaped as an SQL identifier +ERROR: null values cannot be formatted as an SQL identifier -- check positional placeholders select format('%1$s %3$s', 1, 2, 3); format diff --git a/src/test/regress/sql/foreign_data.sql b/src/test/regress/sql/foreign_data.sql index d3239216c1..58e5060477 100644 --- a/src/test/regress/sql/foreign_data.sql +++ b/src/test/regress/sql/foreign_data.sql @@ -294,7 +294,7 @@ ALTER FOREIGN TABLE ft1 ALTER COLUMN c4 SET DEFAULT 0; -- ERROR ALTER FOREIGN TABLE ft1 ALTER COLUMN c5 DROP DEFAULT; -- ERROR ALTER FOREIGN TABLE ft1 ALTER COLUMN c6 SET NOT NULL; ALTER FOREIGN TABLE ft1 ALTER COLUMN c7 DROP NOT NULL; -ALTER FOREIGN TABLE ft1 ALTER COLUMN c8 TYPE char(10) using '0'; -- ERROR +ALTER FOREIGN TABLE ft1 ALTER COLUMN c8 TYPE char(10) USING '0'; -- ERROR ALTER FOREIGN TABLE ft1 ALTER COLUMN c8 TYPE char(10); ALTER FOREIGN TABLE ft1 ALTER COLUMN c8 SET DATA TYPE text; -- can't change the column type if it's used elsewhere -- 2.40.0