Skip to content

Commit d5cb3ba

Browse files
committed
Fix improper quoting of format_type_be() output.
Per our message style guidelines, error messages incorporating the results of format_type_be() and its siblings should not add quotes around those results, because those functions already add quotes at need. Fix a few places that hadn't gotten that memo.
1 parent 68cff23 commit d5cb3ba

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/backend/catalog/pg_aggregate.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ AggregateCreate(const char *aggName,
433433
if (aggTransType == INTERNALOID && func_strict(combinefn))
434434
ereport(ERROR,
435435
(errcode(ERRCODE_INVALID_FUNCTION_DEFINITION),
436-
errmsg("combine function with \"%s\" transition type must not be declared STRICT",
436+
errmsg("combine function with transition type %s must not be declared STRICT",
437437
format_type_be(aggTransType))));
438438

439439
}

src/backend/catalog/pg_constraint.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -843,8 +843,8 @@ get_domain_constraint_oid(Oid typid, const char *conname, bool missing_ok)
843843
if (OidIsValid(conOid))
844844
ereport(ERROR,
845845
(errcode(ERRCODE_DUPLICATE_OBJECT),
846-
errmsg("domain \"%s\" has multiple constraints named \"%s\"",
847-
format_type_be(typid), conname)));
846+
errmsg("domain %s has multiple constraints named \"%s\"",
847+
format_type_be(typid), conname)));
848848
conOid = HeapTupleGetOid(tuple);
849849
}
850850
}
@@ -855,7 +855,7 @@ get_domain_constraint_oid(Oid typid, const char *conname, bool missing_ok)
855855
if (!OidIsValid(conOid) && !missing_ok)
856856
ereport(ERROR,
857857
(errcode(ERRCODE_UNDEFINED_OBJECT),
858-
errmsg("constraint \"%s\" for domain \"%s\" does not exist",
858+
errmsg("constraint \"%s\" for domain %s does not exist",
859859
conname, format_type_be(typid))));
860860

861861
heap_close(pg_constraint, AccessShareLock);

src/backend/commands/typecmds.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3162,7 +3162,7 @@ RenameType(RenameStmt *stmt)
31623162
if (stmt->renameType == OBJECT_DOMAIN && typTup->typtype != TYPTYPE_DOMAIN)
31633163
ereport(ERROR,
31643164
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
3165-
errmsg("\"%s\" is not a domain",
3165+
errmsg("%s is not a domain",
31663166
format_type_be(typeOid))));
31673167

31683168
/*

src/test/regress/output/constraints.source

+1-1
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ COMMENT ON CONSTRAINT the_constraint ON DOMAIN constraint_comments_dom IS 'yes,
684684
COMMENT ON CONSTRAINT no_constraint ON constraint_comments_tbl IS 'yes, the comment';
685685
ERROR: constraint "no_constraint" for table "constraint_comments_tbl" does not exist
686686
COMMENT ON CONSTRAINT no_constraint ON DOMAIN constraint_comments_dom IS 'yes, another comment';
687-
ERROR: constraint "no_constraint" for domain "constraint_comments_dom" does not exist
687+
ERROR: constraint "no_constraint" for domain constraint_comments_dom does not exist
688688
-- no such table/domain
689689
COMMENT ON CONSTRAINT the_constraint ON no_comments_tbl IS 'bad comment';
690690
ERROR: relation "no_comments_tbl" does not exist

0 commit comments

Comments
 (0)