aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2019-05-08 13:16:54 -0400
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2019-05-08 13:20:16 -0400
commit61639816b870347677e6e6945604e0d9da1837ca (patch)
tree79ccf3c4630dbaec9c471f3933526a0d4d5267df /src
parentdf631ebc737e9d9cdf8d0691969d404f1bd584a4 (diff)
downloadpostgresql-61639816b870347677e6e6945604e0d9da1837ca.tar.gz
postgresql-61639816b870347677e6e6945604e0d9da1837ca.zip
Fix error messages
Some messages related to foreign servers were reporting the server name without quotes, or not at all; our style is to have all names be quoted, and the server name already appears quoted in a few other messages, so just add quotes and make them all consistent. Remove an extra "s" in other messages (typos introduced by myself in f56f8f8da6af).
Diffstat (limited to 'src')
-rw-r--r--src/backend/commands/foreigncmds.c20
-rw-r--r--src/backend/commands/tablecmds.c4
-rw-r--r--src/test/regress/expected/foreign_data.out14
3 files changed, 20 insertions, 18 deletions
diff --git a/src/backend/commands/foreigncmds.c b/src/backend/commands/foreigncmds.c
index 413ce3fcb66..d7bc6e35f02 100644
--- a/src/backend/commands/foreigncmds.c
+++ b/src/backend/commands/foreigncmds.c
@@ -1184,7 +1184,7 @@ CreateUserMapping(CreateUserMappingStmt *stmt)
{
ereport(NOTICE,
(errcode(ERRCODE_DUPLICATE_OBJECT),
- errmsg("user mapping for \"%s\" already exists for server %s, skipping",
+ errmsg("user mapping for \"%s\" already exists for server \"%s\", skipping",
MappingUserName(useId),
stmt->servername)));
@@ -1194,7 +1194,7 @@ CreateUserMapping(CreateUserMappingStmt *stmt)
else
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_OBJECT),
- errmsg("user mapping for \"%s\" already exists for server %s",
+ errmsg("user mapping for \"%s\" already exists for server \"%s\"",
MappingUserName(useId),
stmt->servername)));
}
@@ -1294,8 +1294,8 @@ AlterUserMapping(AlterUserMappingStmt *stmt)
if (!OidIsValid(umId))
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
- errmsg("user mapping for \"%s\" does not exist for the server",
- MappingUserName(useId))));
+ errmsg("user mapping for \"%s\" does not exist for server \"%s\"",
+ MappingUserName(useId), stmt->servername)));
user_mapping_ddl_aclcheck(useId, srv->serverid, stmt->servername);
@@ -1396,7 +1396,9 @@ RemoveUserMapping(DropUserMappingStmt *stmt)
errmsg("server \"%s\" does not exist",
stmt->servername)));
/* IF EXISTS, just note it */
- ereport(NOTICE, (errmsg("server does not exist, skipping")));
+ ereport(NOTICE,
+ (errmsg("server \"%s\" does not exist, skipping",
+ stmt->servername)));
return InvalidOid;
}
@@ -1409,13 +1411,13 @@ RemoveUserMapping(DropUserMappingStmt *stmt)
if (!stmt->missing_ok)
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
- errmsg("user mapping for \"%s\" does not exist for the server",
- MappingUserName(useId))));
+ errmsg("user mapping for \"%s\" does not exist for server \"%s\"",
+ MappingUserName(useId), stmt->servername)));
/* IF EXISTS specified, just note it */
ereport(NOTICE,
- (errmsg("user mapping for \"%s\" does not exist for the server, skipping",
- MappingUserName(useId))));
+ (errmsg("user mapping for \"%s\" does not exist for server \"%s\", skipping",
+ MappingUserName(useId), stmt->servername)));
return InvalidOid;
}
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 8e4743d1101..03daa252817 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -8184,7 +8184,7 @@ addFkRecurseReferencing(List **wqueue, Constraint *fkconstraint, Relation rel,
if (rel->rd_rel->relkind == RELKIND_FOREIGN_TABLE)
ereport(ERROR,
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
- errmsg("foreign keys constraints are not supported on foreign tables")));
+ errmsg("foreign key constraints are not supported on foreign tables")));
/*
* If the referencing relation is a plain table, add the check triggers to
@@ -8572,7 +8572,7 @@ CloneFkReferencing(List **wqueue, Relation parentRel, Relation partRel)
if (partRel->rd_rel->relkind == RELKIND_FOREIGN_TABLE)
ereport(ERROR,
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
- errmsg("foreign keys constraints are not supported on foreign tables")));
+ errmsg("foreign key constraints are not supported on foreign tables")));
/*
* The constraint key may differ, if the columns in the partition are
diff --git a/src/test/regress/expected/foreign_data.out b/src/test/regress/expected/foreign_data.out
index 3dfe888410f..c81e4bda807 100644
--- a/src/test/regress/expected/foreign_data.out
+++ b/src/test/regress/expected/foreign_data.out
@@ -238,9 +238,9 @@ CREATE SERVER s1 FOREIGN DATA WRAPPER foo;
COMMENT ON SERVER s1 IS 'foreign server';
CREATE USER MAPPING FOR current_user SERVER s1;
CREATE USER MAPPING FOR current_user SERVER s1; -- ERROR
-ERROR: user mapping for "regress_foreign_data_user" already exists for server s1
+ERROR: user mapping for "regress_foreign_data_user" already exists for server "s1"
CREATE USER MAPPING IF NOT EXISTS FOR current_user SERVER s1; -- NOTICE
-NOTICE: user mapping for "regress_foreign_data_user" already exists for server s1, skipping
+NOTICE: user mapping for "regress_foreign_data_user" already exists for server "s1", skipping
\dew+
List of foreign-data wrappers
Name | Owner | Handler | Validator | Access privileges | FDW options | Description
@@ -578,7 +578,7 @@ CREATE USER MAPPING FOR current_user SERVER s1; -- ERROR
ERROR: server "s1" does not exist
CREATE USER MAPPING FOR current_user SERVER s4;
CREATE USER MAPPING FOR user SERVER s4; -- ERROR duplicate
-ERROR: user mapping for "regress_foreign_data_user" already exists for server s4
+ERROR: user mapping for "regress_foreign_data_user" already exists for server "s4"
CREATE USER MAPPING FOR public SERVER s4 OPTIONS ("this mapping" 'is public');
CREATE USER MAPPING FOR user SERVER s8 OPTIONS (username 'test', password 'secret'); -- ERROR
ERROR: invalid option "username"
@@ -618,7 +618,7 @@ ERROR: role "regress_test_missing_role" does not exist
ALTER USER MAPPING FOR user SERVER ss4 OPTIONS (gotcha 'true'); -- ERROR
ERROR: server "ss4" does not exist
ALTER USER MAPPING FOR public SERVER s5 OPTIONS (gotcha 'true'); -- ERROR
-ERROR: user mapping for "public" does not exist for the server
+ERROR: user mapping for "public" does not exist for server "s5"
ALTER USER MAPPING FOR current_user SERVER s8 OPTIONS (username 'test'); -- ERROR
ERROR: invalid option "username"
HINT: Valid options in this context are: user, password
@@ -648,13 +648,13 @@ ERROR: role "regress_test_missing_role" does not exist
DROP USER MAPPING FOR user SERVER ss4;
ERROR: server "ss4" does not exist
DROP USER MAPPING FOR public SERVER s7; -- ERROR
-ERROR: user mapping for "public" does not exist for the server
+ERROR: user mapping for "public" does not exist for server "s7"
DROP USER MAPPING IF EXISTS FOR regress_test_missing_role SERVER s4;
NOTICE: role "regress_test_missing_role" does not exist, skipping
DROP USER MAPPING IF EXISTS FOR user SERVER ss4;
-NOTICE: server does not exist, skipping
+NOTICE: server "ss4" does not exist, skipping
DROP USER MAPPING IF EXISTS FOR public SERVER s7;
-NOTICE: user mapping for "public" does not exist for the server, skipping
+NOTICE: user mapping for "public" does not exist for server "s7", skipping
CREATE USER MAPPING FOR public SERVER s8;
SET ROLE regress_test_role;
DROP USER MAPPING FOR public SERVER s8; -- ERROR