Fix improper quoting of format_type_be() output.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 30 May 2017 01:48:26 +0000 (21:48 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 30 May 2017 01:48:26 +0000 (21:48 -0400)
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.

src/backend/catalog/pg_aggregate.c
src/backend/catalog/pg_constraint.c
src/backend/commands/typecmds.c
src/test/regress/output/constraints.source

index ac06823999de236abe4f9c3bdb02acd1a24fcfe4..65c2e88e9352276a0f8398f25dc24e16c5e138c8 100644 (file)
@@ -433,7 +433,7 @@ AggregateCreate(const char *aggName,
        if (aggTransType == INTERNALOID && func_strict(combinefn))
            ereport(ERROR,
                    (errcode(ERRCODE_INVALID_FUNCTION_DEFINITION),
-                    errmsg("combine function with \"%s\" transition type must not be declared STRICT",
+                    errmsg("combine function with transition type %s must not be declared STRICT",
                            format_type_be(aggTransType))));
 
    }
index 62be80d800e6264526f64ab08c828c760abce074..e5ae3d92922dd2a0396f557f0e6cb9c168a1e8b5 100644 (file)
@@ -843,8 +843,8 @@ get_domain_constraint_oid(Oid typid, const char *conname, bool missing_ok)
            if (OidIsValid(conOid))
                ereport(ERROR,
                        (errcode(ERRCODE_DUPLICATE_OBJECT),
-               errmsg("domain \"%s\" has multiple constraints named \"%s\"",
-                      format_type_be(typid), conname)));
+                   errmsg("domain %s has multiple constraints named \"%s\"",
+                          format_type_be(typid), conname)));
            conOid = HeapTupleGetOid(tuple);
        }
    }
@@ -855,7 +855,7 @@ get_domain_constraint_oid(Oid typid, const char *conname, bool missing_ok)
    if (!OidIsValid(conOid) && !missing_ok)
        ereport(ERROR,
                (errcode(ERRCODE_UNDEFINED_OBJECT),
-                errmsg("constraint \"%s\" for domain \"%s\" does not exist",
+                errmsg("constraint \"%s\" for domain %s does not exist",
                        conname, format_type_be(typid))));
 
    heap_close(pg_constraint, AccessShareLock);
index c765e97fa802cbc582f0d7b2b32f2685b799dd86..e7ecc4ed7e53ef26c97850f988698ab81651b718 100644 (file)
@@ -3162,7 +3162,7 @@ RenameType(RenameStmt *stmt)
    if (stmt->renameType == OBJECT_DOMAIN && typTup->typtype != TYPTYPE_DOMAIN)
        ereport(ERROR,
                (errcode(ERRCODE_WRONG_OBJECT_TYPE),
-                errmsg("\"%s\" is not a domain",
+                errmsg("%s is not a domain",
                        format_type_be(typeOid))));
 
    /*
index e6d317438044d82c1d11cb0ca9bcf8ff62e85342..bb75165cc22d433b9ccf0cc8af88954c881e9d6a 100644 (file)
@@ -684,7 +684,7 @@ COMMENT ON CONSTRAINT the_constraint ON DOMAIN constraint_comments_dom IS 'yes,
 COMMENT ON CONSTRAINT no_constraint ON constraint_comments_tbl IS 'yes, the comment';
 ERROR:  constraint "no_constraint" for table "constraint_comments_tbl" does not exist
 COMMENT ON CONSTRAINT no_constraint ON DOMAIN constraint_comments_dom IS 'yes, another comment';
-ERROR:  constraint "no_constraint" for domain "constraint_comments_dom" does not exist
+ERROR:  constraint "no_constraint" for domain constraint_comments_dom does not exist
 -- no such table/domain
 COMMENT ON CONSTRAINT the_constraint ON no_comments_tbl IS 'bad comment';
 ERROR:  relation "no_comments_tbl" does not exist