@@ -160,7 +160,6 @@ PathmanDoCopy(const CopyStmt *stmt, const char *queryString, uint64 *processed)
160
160
bool is_from = stmt -> is_from ;
161
161
bool pipe = (stmt -> filename == NULL );
162
162
Relation rel ;
163
- Oid relid ;
164
163
Node * query = NULL ;
165
164
List * range_table = NIL ;
166
165
@@ -194,8 +193,6 @@ PathmanDoCopy(const CopyStmt *stmt, const char *queryString, uint64 *processed)
194
193
/* Open the relation (we've locked it in is_pathman_related_copy()) */
195
194
rel = heap_openrv (stmt -> relation ,NoLock );
196
195
197
- relid = RelationGetRelid (rel );
198
-
199
196
rte = makeNode (RangeTblEntry );
200
197
rte -> rtekind = RTE_RELATION ;
201
198
rte -> relid = RelationGetRelid (rel );
@@ -280,7 +277,6 @@ PathmanDoCopy(const CopyStmt *stmt, const char *queryString, uint64 *processed)
280
277
Assert (stmt -> query );
281
278
282
279
query = stmt -> query ;
283
- relid = InvalidOid ;
284
280
rel = NULL ;
285
281
}
286
282
@@ -291,7 +287,7 @@ PathmanDoCopy(const CopyStmt *stmt, const char *queryString, uint64 *processed)
291
287
Assert (rel );
292
288
293
289
/* check read-only transaction and parallel mode */
294
- if (XactReadOnly && !rel -> rd_islocaltemp )
290
+ if (XactReadOnly && rel && !rel -> rd_islocaltemp )
295
291
PreventCommandIfReadOnly ("PATHMAN COPY FROM" );
296
292
PreventCommandIfParallelMode ("PATHMAN COPY FROM" );
297
293