Remove redundant spaces in _outA_Expr() output
authorPeter Eisentraut <[email protected]>
Mon, 15 Aug 2022 10:43:52 +0000 (12:43 +0200)
committerPeter Eisentraut <[email protected]>
Mon, 15 Aug 2022 10:43:52 +0000 (12:43 +0200)
Since WRITE_NODE_FIELD() output always starts with a space, we don't
need to go out of our way to print another space right before it.

This change is only for visual appearance; the tokenizer on the
reading side would read it the same way (but there is no read support
for A_Expr at this time anyway).

src/backend/nodes/outfuncs.c

index 5da76cdc6ba9a1401a0b9187203ef502adc53c37..60610e3a4bd5aa19e5c0696dcc37b01cc10aa84c 100644 (file)
@@ -545,61 +545,58 @@ _outA_Expr(StringInfo str, const A_Expr *node)
        switch (node->kind)
        {
                case AEXPR_OP:
-                       appendStringInfoChar(str, ' ');
                        WRITE_NODE_FIELD(name);
                        break;
                case AEXPR_OP_ANY:
-                       appendStringInfoChar(str, ' ');
                        WRITE_NODE_FIELD(name);
-                       appendStringInfoString(str, " ANY ");
+                       appendStringInfoString(str, " ANY");
                        break;
                case AEXPR_OP_ALL:
-                       appendStringInfoChar(str, ' ');
                        WRITE_NODE_FIELD(name);
-                       appendStringInfoString(str, " ALL ");
+                       appendStringInfoString(str, " ALL");
                        break;
                case AEXPR_DISTINCT:
-                       appendStringInfoString(str, " DISTINCT ");
+                       appendStringInfoString(str, " DISTINCT");
                        WRITE_NODE_FIELD(name);
                        break;
                case AEXPR_NOT_DISTINCT:
-                       appendStringInfoString(str, " NOT_DISTINCT ");
+                       appendStringInfoString(str, " NOT_DISTINCT");
                        WRITE_NODE_FIELD(name);
                        break;
                case AEXPR_NULLIF:
-                       appendStringInfoString(str, " NULLIF ");
+                       appendStringInfoString(str, " NULLIF");
                        WRITE_NODE_FIELD(name);
                        break;
                case AEXPR_IN:
-                       appendStringInfoString(str, " IN ");
+                       appendStringInfoString(str, " IN");
                        WRITE_NODE_FIELD(name);
                        break;
                case AEXPR_LIKE:
-                       appendStringInfoString(str, " LIKE ");
+                       appendStringInfoString(str, " LIKE");
                        WRITE_NODE_FIELD(name);
                        break;
                case AEXPR_ILIKE:
-                       appendStringInfoString(str, " ILIKE ");
+                       appendStringInfoString(str, " ILIKE");
                        WRITE_NODE_FIELD(name);
                        break;
                case AEXPR_SIMILAR:
-                       appendStringInfoString(str, " SIMILAR ");
+                       appendStringInfoString(str, " SIMILAR");
                        WRITE_NODE_FIELD(name);
                        break;
                case AEXPR_BETWEEN:
-                       appendStringInfoString(str, " BETWEEN ");
+                       appendStringInfoString(str, " BETWEEN");
                        WRITE_NODE_FIELD(name);
                        break;
                case AEXPR_NOT_BETWEEN:
-                       appendStringInfoString(str, " NOT_BETWEEN ");
+                       appendStringInfoString(str, " NOT_BETWEEN");
                        WRITE_NODE_FIELD(name);
                        break;
                case AEXPR_BETWEEN_SYM:
-                       appendStringInfoString(str, " BETWEEN_SYM ");
+                       appendStringInfoString(str, " BETWEEN_SYM");
                        WRITE_NODE_FIELD(name);
                        break;
                case AEXPR_NOT_BETWEEN_SYM:
-                       appendStringInfoString(str, " NOT_BETWEEN_SYM ");
+                       appendStringInfoString(str, " NOT_BETWEEN_SYM");
                        WRITE_NODE_FIELD(name);
                        break;
                default: