Skip to content

Commit

Permalink
Deparse COPY ... FORCE_NULL(*)
Browse files Browse the repository at this point in the history
  • Loading branch information
msepga committed Sep 26, 2024
1 parent f06cb5c commit 9567d77
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions src/postgres_deparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -7546,15 +7546,29 @@ static void deparseCopyStmt(StringInfo str, CopyStmt *copy_stmt)
}
else if (strcmp(def_elem->defname, "force_not_null") == 0)
{
appendStringInfoString(str, "FORCE_NOT_NULL (");
deparseColumnList(str, castNode(List, def_elem->arg));
appendStringInfoChar(str, ')');
appendStringInfoString(str, "FORCE_NOT_NULL ");

if (IsA(def_elem->arg, A_Star))
deparseAStar(str, castNode(A_Star, def_elem->arg));
else
{
appendStringInfoChar(str, '(');
deparseColumnList(str, castNode(List, def_elem->arg));
appendStringInfoChar(str, ')');
}
}
else if (strcmp(def_elem->defname, "force_null") == 0)
{
appendStringInfoString(str, "FORCE_NULL (");
deparseColumnList(str, castNode(List, def_elem->arg));
appendStringInfoChar(str, ')');
appendStringInfoString(str, "FORCE_NULL ");

if (IsA(def_elem->arg, A_Star))
deparseAStar(str, castNode(A_Star, def_elem->arg));
else
{
appendStringInfoChar(str, '(');
deparseColumnList(str, castNode(List, def_elem->arg));
appendStringInfoChar(str, ')');
}
}
else if (strcmp(def_elem->defname, "encoding") == 0)
{
Expand Down

0 comments on commit 9567d77

Please sign in to comment.