mirror of https://github.com/citusdata/citus.git
Don't throw error for DROP DATABASE IF EXISTS
parent
28d307850c
commit
3e00bf1c0d
|
@ -549,12 +549,16 @@ multi_ProcessUtility(PlannedStmt *pstmt,
|
|||
*/
|
||||
if (IsA(parsetree, DropdbStmt))
|
||||
{
|
||||
const bool missingOK = true;
|
||||
DropdbStmt *dropDbStatement = (DropdbStmt *) parsetree;
|
||||
char *dbname = dropDbStatement->dbname;
|
||||
Oid databaseOid = get_database_oid(dbname, false);
|
||||
Oid databaseOid = get_database_oid(dbname, missingOK);
|
||||
|
||||
if (OidIsValid(databaseOid))
|
||||
{
|
||||
StopMaintenanceDaemon(databaseOid);
|
||||
}
|
||||
}
|
||||
|
||||
/* set user if needed and go ahead and run local utility using standard hook */
|
||||
if (commandMustRunAsOwner)
|
||||
|
|
|
@ -268,3 +268,10 @@ FETCH BACKWARD noHoldCursor;
|
|||
COMMIT;
|
||||
FETCH ABSOLUTE 5 FROM noHoldCursor;
|
||||
ERROR: cursor "noholdcursor" does not exist
|
||||
-- Test we don't throw an error for DROP IF EXISTS
|
||||
DROP DATABASE IF EXISTS not_existing_database;
|
||||
NOTICE: database "not_existing_database" does not exist, skipping
|
||||
DROP TABLE IF EXISTS not_existing_table;
|
||||
NOTICE: table "not_existing_table" does not exist, skipping
|
||||
DROP SCHEMA IF EXISTS not_existing_schema;
|
||||
NOTICE: schema "not_existing_schema" does not exist, skipping
|
||||
|
|
|
@ -146,3 +146,8 @@ FETCH ABSOLUTE 5 FROM noHoldCursor;
|
|||
FETCH BACKWARD noHoldCursor;
|
||||
COMMIT;
|
||||
FETCH ABSOLUTE 5 FROM noHoldCursor;
|
||||
|
||||
-- Test we don't throw an error for DROP IF EXISTS
|
||||
DROP DATABASE IF EXISTS not_existing_database;
|
||||
DROP TABLE IF EXISTS not_existing_table;
|
||||
DROP SCHEMA IF EXISTS not_existing_schema;
|
||||
|
|
Loading…
Reference in New Issue