Commit 07e5e667 authored by Peter Eisentraut's avatar Peter Eisentraut

Improve quoting in some error messages

parent ac725ee0
...@@ -290,7 +290,7 @@ bt_index_check_internal(Oid indrelid, bool parentcheck, bool heapallindexed, ...@@ -290,7 +290,7 @@ bt_index_check_internal(Oid indrelid, bool parentcheck, bool heapallindexed,
if (heaprel == NULL || heapid != IndexGetRelation(indrelid, false)) if (heaprel == NULL || heapid != IndexGetRelation(indrelid, false))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_TABLE), (errcode(ERRCODE_UNDEFINED_TABLE),
errmsg("could not open parent table of index %s", errmsg("could not open parent table of index \"%s\"",
RelationGetRelationName(indrel)))); RelationGetRelationName(indrel))));
/* Relation suitable for checking as B-Tree? */ /* Relation suitable for checking as B-Tree? */
...@@ -535,7 +535,7 @@ bt_check_every_level(Relation rel, Relation heaprel, bool heapkeyspace, ...@@ -535,7 +535,7 @@ bt_check_every_level(Relation rel, Relation heaprel, bool heapkeyspace,
if (metad->btm_fastroot != metad->btm_root) if (metad->btm_fastroot != metad->btm_root)
ereport(DEBUG1, ereport(DEBUG1,
(errcode(ERRCODE_NO_DATA), (errcode(ERRCODE_NO_DATA),
errmsg_internal("harmless fast root mismatch in index %s", errmsg_internal("harmless fast root mismatch in index \"%s\"",
RelationGetRelationName(rel)), RelationGetRelationName(rel)),
errdetail_internal("Fast root block %u (level %u) differs from true root block %u (level %u).", errdetail_internal("Fast root block %u (level %u) differs from true root block %u (level %u).",
metad->btm_fastroot, metad->btm_fastlevel, metad->btm_fastroot, metad->btm_fastlevel,
...@@ -2277,7 +2277,7 @@ bt_downlink_missing_check(BtreeCheckState *state, bool rightsplit, ...@@ -2277,7 +2277,7 @@ bt_downlink_missing_check(BtreeCheckState *state, bool rightsplit,
{ {
ereport(DEBUG1, ereport(DEBUG1,
(errcode(ERRCODE_NO_DATA), (errcode(ERRCODE_NO_DATA),
errmsg_internal("harmless interrupted page split detected in index %s", errmsg_internal("harmless interrupted page split detected in index \"%s\"",
RelationGetRelationName(state->rel)), RelationGetRelationName(state->rel)),
errdetail_internal("Block=%u level=%u left sibling=%u page lsn=%X/%X.", errdetail_internal("Block=%u level=%u left sibling=%u page lsn=%X/%X.",
blkno, opaque->btpo_level, blkno, opaque->btpo_level,
......
...@@ -1060,7 +1060,7 @@ brin_summarize_range(PG_FUNCTION_ARGS) ...@@ -1060,7 +1060,7 @@ brin_summarize_range(PG_FUNCTION_ARGS)
if (heapRel == NULL || heapoid != IndexGetRelation(indexoid, false)) if (heapRel == NULL || heapoid != IndexGetRelation(indexoid, false))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_TABLE), (errcode(ERRCODE_UNDEFINED_TABLE),
errmsg("could not open parent table of index %s", errmsg("could not open parent table of index \"%s\"",
RelationGetRelationName(indexRel)))); RelationGetRelationName(indexRel))));
/* OK, do it */ /* OK, do it */
...@@ -1137,7 +1137,7 @@ brin_desummarize_range(PG_FUNCTION_ARGS) ...@@ -1137,7 +1137,7 @@ brin_desummarize_range(PG_FUNCTION_ARGS)
if (heapRel == NULL || heapoid != IndexGetRelation(indexoid, false)) if (heapRel == NULL || heapoid != IndexGetRelation(indexoid, false))
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_TABLE), (errcode(ERRCODE_UNDEFINED_TABLE),
errmsg("could not open parent table of index %s", errmsg("could not open parent table of index \"%s\"",
RelationGetRelationName(indexRel)))); RelationGetRelationName(indexRel))));
/* the revmap does the hard work */ /* the revmap does the hard work */
......
...@@ -93,14 +93,14 @@ ...@@ -93,14 +93,14 @@
#define CHECK_REL_PROCEDURE(pname) \ #define CHECK_REL_PROCEDURE(pname) \
do { \ do { \
if (indexRelation->rd_indam->pname == NULL) \ if (indexRelation->rd_indam->pname == NULL) \
elog(ERROR, "function %s is not defined for index %s", \ elog(ERROR, "function \"%s\" is not defined for index \"%s\"", \
CppAsString(pname), RelationGetRelationName(indexRelation)); \ CppAsString(pname), RelationGetRelationName(indexRelation)); \
} while(0) } while(0)
#define CHECK_SCAN_PROCEDURE(pname) \ #define CHECK_SCAN_PROCEDURE(pname) \
do { \ do { \
if (scan->indexRelation->rd_indam->pname == NULL) \ if (scan->indexRelation->rd_indam->pname == NULL) \
elog(ERROR, "function %s is not defined for index %s", \ elog(ERROR, "function \"%s\" is not defined for index \"%s\"", \
CppAsString(pname), RelationGetRelationName(scan->indexRelation)); \ CppAsString(pname), RelationGetRelationName(scan->indexRelation)); \
} while(0) } while(0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment