diff --git a/src/backend/commands/tablespace.c b/src/backend/commands/tablespace.c
index ff0d904..eba9c6a 100644
--- a/src/backend/commands/tablespace.c
+++ b/src/backend/commands/tablespace.c
@@ -383,13 +383,15 @@ CreateTableSpace(CreateTableSpaceStmt *stmt)
 
 	/* We keep the lock on pg_tablespace until commit */
 	heap_close(rel, NoLock);
+
+	return tablespaceoid;
 #else							/* !HAVE_SYMLINK */
 	ereport(ERROR,
 			(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
 			 errmsg("tablespaces are not supported on this platform")));
-#endif   /* HAVE_SYMLINK */
 
-	return tablespaceoid;
+	return InvalidOid;
+#endif   /* HAVE_SYMLINK */
 }
 
 /*
