Backport missing pieces of 4a2dde4612

Sorry, I forgot to reflect the changes done in alter_table.c to
create_distributed_table.c when backporting
35043c56f1.
pull/5409/head
Onur Tirtir 2021-09-08 16:33:14 +03:00
parent 355a774087
commit 963bf8559c
1 changed files with 4 additions and 1 deletions

View File

@ -1721,8 +1721,11 @@ GetViewCreationCommandsOfTable(Oid relationId)
char *viewName = get_rel_name(viewOid);
char *schemaName = get_namespace_name(get_rel_namespace(viewOid));
char *qualifiedViewName = quote_qualified_identifier(schemaName, viewName);
bool isMatView = get_rel_relkind(viewOid) == RELKIND_MATVIEW;
appendStringInfo(query,
"CREATE VIEW %s AS %s",
"CREATE %s VIEW %s AS %s",
isMatView ? "MATERIALIZED" : "",
qualifiedViewName,
viewDefinition);
commands = lappend(commands, query->data);