diff --git a/doc/src/sgml/ref/alter_database.sgml b/doc/src/sgml/ref/alter_database.sgml
new file mode 100644
index 360732f..98ea473
*** a/doc/src/sgml/ref/alter_database.sgml
--- b/doc/src/sgml/ref/alter_database.sgml
*************** ALTER DATABASE connlimit
! ALTER DATABASE name RENAME TO new_name
ALTER DATABASE name OWNER TO new_owner
--- 27,33 ----
CONNECTION LIMIT connlimit
! ALTER DATABASE name RENAME TO new_name [ FORCE ]
ALTER DATABASE name OWNER TO new_owner
*************** ALTER DATABASE newname = $6;
$$ = (Node *)n;
}
! | ALTER DATABASE database_name RENAME TO database_name
{
RenameStmt *n = makeNode(RenameStmt);
n->renameType = OBJECT_DATABASE;
n->subname = $3;
n->newname = $6;
$$ = (Node *)n;
}
| ALTER FUNCTION function_with_argtypes RENAME TO name
--- 6437,6449 ----
n->newname = $6;
$$ = (Node *)n;
}
! | ALTER DATABASE database_name RENAME TO database_name opt_force
{
RenameStmt *n = makeNode(RenameStmt);
n->renameType = OBJECT_DATABASE;
n->subname = $3;
n->newname = $6;
+ n->force = $7;
$$ = (Node *)n;
}
| ALTER FUNCTION function_with_argtypes RENAME TO name
*************** opt_column: COLUMN { $$ = COLUMN
*** 6675,6680 ****
--- 6673,6681 ----
opt_set_data: SET DATA_P { $$ = 1; }
| /*EMPTY*/ { $$ = 0; }
;
+ opt_force: FORCE { $$ = TRUE; }
+ | /* EMPTY */ { $$ = FALSE; }
+ ;
/*****************************************************************************
*
diff --git a/src/include/commands/dbcommands.h b/src/include/commands/dbcommands.h
new file mode 100644
index 21dacff..68141b8
*** a/src/include/commands/dbcommands.h
--- b/src/include/commands/dbcommands.h
*************** typedef struct xl_dbase_drop_rec
*** 54,60 ****
extern void createdb(const CreatedbStmt *stmt);
extern void dropdb(const char *dbname, bool missing_ok);
! extern void RenameDatabase(const char *oldname, const char *newname);
extern void AlterDatabase(AlterDatabaseStmt *stmt, bool isTopLevel);
extern void AlterDatabaseSet(AlterDatabaseSetStmt *stmt);
extern void AlterDatabaseOwner(const char *dbname, Oid newOwnerId);
--- 54,60 ----
extern void createdb(const CreatedbStmt *stmt);
extern void dropdb(const char *dbname, bool missing_ok);
! extern void RenameDatabase(const char *oldname, const char *newname, bool force);
extern void AlterDatabase(AlterDatabaseStmt *stmt, bool isTopLevel);
extern void AlterDatabaseSet(AlterDatabaseSetStmt *stmt);
extern void AlterDatabaseOwner(const char *dbname, Oid newOwnerId);
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h
new file mode 100644
index af6565e..8d30af9
*** a/src/include/nodes/parsenodes.h
--- b/src/include/nodes/parsenodes.h
*************** typedef struct RenameStmt
*** 2193,2198 ****
--- 2193,2199 ----
* trigger, etc) */
char *newname; /* the new name */
DropBehavior behavior; /* RESTRICT or CASCADE behavior */
+ bool force; /* with prejudice */
} RenameStmt;
/* ----------------------