summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/commands/copy.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c
index 37d9a898cf..a5122e61f6 100644
--- a/src/backend/commands/copy.c
+++ b/src/backend/commands/copy.c
@@ -1567,9 +1567,9 @@ BeginCopy(ParseState *pstate,
* will ultimately lead to an error, but doing it here allows us to
* throw a more friendly and PG-compatible error.
*/
- if (IsA(raw_query, SelectStmt))
+ if (IsA(raw_query->stmt, SelectStmt))
{
- SelectStmt *stmt = (SelectStmt *) raw_query;
+ SelectStmt *stmt = (SelectStmt *) raw_query->stmt;
/*
* If it's a set-operation tree, drilldown to leftmost SelectStmt