1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-16 17:07:43 +03:00

Message improvements

This commit is contained in:
Peter Eisentraut
2015-11-16 21:16:42 -05:00
parent 53264c7b1e
commit 5db837d3f2
26 changed files with 78 additions and 82 deletions

View File

@@ -874,7 +874,7 @@ DoCopy(const CopyStmt *stmt, const char *queryString, uint64 *processed)
if (is_from)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("COPY FROM not supported with row level security."),
errmsg("COPY FROM not supported with row-level security."),
errhint("Use INSERT statements instead.")));
/* Build target list */

View File

@@ -3111,7 +3111,7 @@ read_whole_file(const char *filename, int *length)
if (fst.st_size > (MaxAllocSize - 1))
ereport(ERROR,
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
errmsg("file too large")));
errmsg("file \"%s\" is too large", filename)));
bytes_to_read = (size_t) fst.st_size;
if ((file = AllocateFile(filename, PG_BINARY_R)) == NULL)

View File

@@ -11213,10 +11213,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:
@@ -11274,11 +11272,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
@@ -11286,11 +11282,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))));
}

View File

@@ -800,7 +800,7 @@ remove_symlink:
/* Refuse to remove anything that's not a directory or symlink */
ereport(redo ? LOG : ERROR,
(ERRCODE_SYSTEM_ERROR,
errmsg("not a directory or symbolic link: \"%s\"",
errmsg("\"%s\" is not a directory or symbolic link",
linkloc)));
}
@@ -886,7 +886,7 @@ remove_tablespace_symlink(const char *linkloc)
{
/* Refuse to remove anything that's not a directory or symlink */
ereport(ERROR,
(errmsg("not a directory or symbolic link: \"%s\"",
(errmsg("\"%s\" is not a directory or symbolic link",
linkloc)));
}
}