diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c
index 31a0288..00f859e 100644
--- a/src/backend/commands/copy.c
+++ b/src/backend/commands/copy.c
@@ -750,7 +750,7 @@ DoCopy(const CopyStmt *stmt, const char *queryString, uint64 *processed)
 	bool		is_from = stmt->is_from;
 	bool		pipe = (stmt->filename == NULL);
 	Relation	rel;
-	Oid         relid;
+	Oid         relid = InvalidOid;
 
 	/* Disallow file COPY except to superusers. */
 	if (!pipe && !superuser())
