From 689cabf402c33a69e595a0d25f61b1fb49fb1c78 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 16 Nov 2015 21:16:42 -0500 Subject: Message improvements --- src/backend/commands/tablecmds.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'src/backend/commands/tablecmds.c') diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index cf99de4e8db..c5bfee68a5a 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -11195,10 +11195,8 @@ ATPrepChangePersistence(Relation rel, bool toLogged) case RELPERSISTENCE_TEMP: ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), - errmsg("cannot change logged status of table %s", + errmsg("cannot change logged status of table \"%s\" because it is temporary", RelationGetRelationName(rel)), - errdetail("Table %s is temporary.", - RelationGetRelationName(rel)), errtable(rel))); break; case RELPERSISTENCE_PERMANENT: @@ -11256,11 +11254,9 @@ ATPrepChangePersistence(Relation rel, bool toLogged) if (foreignrel->rd_rel->relpersistence != RELPERSISTENCE_PERMANENT) ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), - errmsg("cannot change status of table %s to logged", - RelationGetRelationName(rel)), - errdetail("Table %s references unlogged table %s.", - RelationGetRelationName(rel), - RelationGetRelationName(foreignrel)), + errmsg("could not change table \"%s\" to logged because it references unlogged table \"%s\"", + RelationGetRelationName(rel), + RelationGetRelationName(foreignrel)), errtableconstraint(rel, NameStr(con->conname)))); } else @@ -11268,11 +11264,9 @@ ATPrepChangePersistence(Relation rel, bool toLogged) if (foreignrel->rd_rel->relpersistence == RELPERSISTENCE_PERMANENT) ereport(ERROR, (errcode(ERRCODE_INVALID_TABLE_DEFINITION), - errmsg("cannot change status of table %s to unlogged", - RelationGetRelationName(rel)), - errdetail("Logged table %s is referenced by table %s.", - RelationGetRelationName(foreignrel), - RelationGetRelationName(rel)), + errmsg("could not change table \"%s\" to unlogged because it references logged table \"%s\"", + RelationGetRelationName(rel), + RelationGetRelationName(foreignrel)), errtableconstraint(rel, NameStr(con->conname)))); } -- cgit v1.2.3