aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/schemacmds.c
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2005-11-19 17:39:45 +0000
committerAndrew Dunstan <andrew@dunslane.net>2005-11-19 17:39:45 +0000
commitdaea4d8eaee010f41e46bb98cd1b2da2f9fb75d9 (patch)
treea7232bf09a071a87a955337395b9cefd4a62a8e8 /src/backend/commands/schemacmds.c
parent8ef289dba12f16f3692c235863a887672499a5d9 (diff)
downloadpostgresql-daea4d8eaee010f41e46bb98cd1b2da2f9fb75d9.tar.gz
postgresql-daea4d8eaee010f41e46bb98cd1b2da2f9fb75d9.zip
DROP objecttype IF EXISTS for the following objects:
table view index sequence schema type domain conversion
Diffstat (limited to 'src/backend/commands/schemacmds.c')
-rw-r--r--src/backend/commands/schemacmds.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/backend/commands/schemacmds.c b/src/backend/commands/schemacmds.c
index 56a3359a532..caa336d2c45 100644
--- a/src/backend/commands/schemacmds.c
+++ b/src/backend/commands/schemacmds.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/schemacmds.c,v 1.35 2005/10/15 02:49:15 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/schemacmds.c,v 1.36 2005/11/19 17:39:44 adunstan Exp $
*
*-------------------------------------------------------------------------
*/
@@ -147,7 +147,7 @@ CreateSchemaCommand(CreateSchemaStmt *stmt)
* Removes a schema.
*/
void
-RemoveSchema(List *names, DropBehavior behavior)
+RemoveSchema(List *names, DropBehavior behavior, bool missing_ok)
{
char *namespaceName;
Oid namespaceId;
@@ -163,9 +163,22 @@ RemoveSchema(List *names, DropBehavior behavior)
CStringGetDatum(namespaceName),
0, 0, 0);
if (!OidIsValid(namespaceId))
- ereport(ERROR,
- (errcode(ERRCODE_UNDEFINED_SCHEMA),
- errmsg("schema \"%s\" does not exist", namespaceName)));
+ {
+ if (!missing_ok)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_UNDEFINED_SCHEMA),
+ errmsg("schema \"%s\" does not exist", namespaceName)));
+ }
+ else
+ {
+ ereport(NOTICE,
+ (errmsg("schema \"%s\" does not exist, skipping",
+ namespaceName)));
+ }
+
+ return;
+ }
/* Permission check */
if (!pg_namespace_ownercheck(namespaceId, GetUserId()))