mirror of
https://github.com/postgres/postgres.git
synced 2025-06-11 20:28:21 +03:00
Use castNode() in a bunch of statement-list-related code.
When I wrote commit ab1f0c822
, I really missed the castNode() macro that
Peter E. had proposed shortly before. This back-fills the uses I would
have put it to. It's probably not all that significant, but there are
more assertions here than there were before, and conceivably they will
help catch any bugs associated with those representation changes.
I left behind a number of usages like "(Query *) copyObject(query_var)".
Those could have been converted as well, but Peter has proposed another
notational improvement that would handle copyObject cases automatically,
so I let that be for now.
This commit is contained in:
@ -322,7 +322,7 @@ ExecCreateTableAs(CreateTableAsStmt *stmt, const char *queryString,
|
||||
elog(ERROR, "unexpected rewrite result for %s",
|
||||
is_matview ? "CREATE MATERIALIZED VIEW" :
|
||||
"CREATE TABLE AS SELECT");
|
||||
query = (Query *) linitial(rewritten);
|
||||
query = castNode(Query, linitial(rewritten));
|
||||
Assert(query->commandType == CMD_SELECT);
|
||||
|
||||
/* plan the query --- note we disallow parallelism */
|
||||
|
Reference in New Issue
Block a user