*** a/src/backend/commands/dbcommands.c --- b/src/backend/commands/dbcommands.c *************** *** 303,313 **** createdb(const CreatedbStmt *stmt) */ if (!src_istemplate) { ! if (!pg_database_ownercheck(src_dboid, GetUserId())) ! ereport(ERROR, ! (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), ! errmsg("permission denied to copy database \"%s\"", ! dbtemplate))); } /* If encoding or locales are defaulted, use source's setting */ --- 303,312 ---- */ if (!src_istemplate) { ! ereport(ERROR, ! (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), ! errmsg("DB name \"%s\" given as template is not template database", ! dbtemplate))); } /* If encoding or locales are defaulted, use source's setting */