mirror of
https://github.com/postgres/postgres.git
synced 2025-08-24 09:27:52 +03:00
Use format_type_be() instead of TypeNameToString() for some more user-facing
error messages where the type existence is established.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* Copyright (c) 1996-2008, PostgreSQL Global Development Group
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/commands/comment.c,v 1.103 2008/06/19 00:46:04 alvherre Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/commands/comment.c,v 1.104 2008/10/21 10:38:51 petere Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -882,7 +882,7 @@ CommentType(List *typename, char *comment)
|
||||
|
||||
if (!pg_type_ownercheck(oid, GetUserId()))
|
||||
aclcheck_error(ACLCHECK_NOT_OWNER, ACL_KIND_TYPE,
|
||||
TypeNameToString(tname));
|
||||
format_type_be(oid));
|
||||
|
||||
/* Call CreateComments() to create/drop the comments */
|
||||
CreateComments(oid, TypeRelationId, 0, comment);
|
||||
@@ -1464,8 +1464,8 @@ CommentCast(List *qualname, List *arguments, char *comment)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_UNDEFINED_OBJECT),
|
||||
errmsg("cast from type %s to type %s does not exist",
|
||||
TypeNameToString(sourcetype),
|
||||
TypeNameToString(targettype))));
|
||||
format_type_be(sourcetypeid),
|
||||
format_type_be(targettypeid))));
|
||||
|
||||
/* Get the OID of the cast */
|
||||
castOid = HeapTupleGetOid(tuple);
|
||||
@@ -1476,8 +1476,8 @@ CommentCast(List *qualname, List *arguments, char *comment)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
|
||||
errmsg("must be owner of type %s or type %s",
|
||||
TypeNameToString(sourcetype),
|
||||
TypeNameToString(targettype))));
|
||||
format_type_be(sourcetypeid),
|
||||
format_type_be(targettypeid))));
|
||||
|
||||
ReleaseSysCache(tuple);
|
||||
|
||||
|
Reference in New Issue
Block a user