Index: src/backend/commands/comment.c =================================================================== RCS file: /projects/cvsroot/pgsql/src/backend/commands/comment.c,v retrieving revision 1.43 diff -c -r1.43 comment.c *** src/backend/commands/comment.c 2002/04/19 16:36:08 1.43 --- src/backend/commands/comment.c 2002/04/21 22:43:40 *************** *** 438,443 **** --- 438,447 ---- elog(ERROR, "CommentDatabase: database name may not be qualified"); database = strVal(lfirst(qualname)); + /* Only allow comments on the current database */ + if (strcmp(database, DatabaseName) != 0) + elog(ERROR, "Database comments may only be applied to the current database"); + /* First find the tuple in pg_database for the database */ pg_database = heap_openr(DatabaseRelationName, AccessShareLock);