This is an automated email from the ASF dual-hosted git repository.

maxyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit 6dcf8c9bffe2fce4404918853196f2acfe8f0c6b
Author: Huiliang.liu <[email protected]>
AuthorDate: Mon Feb 13 10:03:51 2023 +0800

    correct fmtopts column format of pg_exttable (#14937)
    
    make each external table options delimited by space.
    
    currently only csv and text fmtopts output is delimited by space. This 
commit makes all formatters align
---
 gpcontrib/gp_exttable_fdw/gp_exttable_fdw.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/gpcontrib/gp_exttable_fdw/gp_exttable_fdw.c 
b/gpcontrib/gp_exttable_fdw/gp_exttable_fdw.c
index 9831fed4bd..6832a7e475 100644
--- a/gpcontrib/gp_exttable_fdw/gp_exttable_fdw.c
+++ b/gpcontrib/gp_exttable_fdw/gp_exttable_fdw.c
@@ -136,10 +136,9 @@ formatOptionsToTextDatum(List *options, char formattype)
        StringInfoData cfbuf;
 
        initStringInfo(&cfbuf);
+       bool isfirst = true;
        if (fmttype_is_text(formattype) || fmttype_is_csv(formattype))
        {
-               bool isfirst = true;
-
                /*
                 * Note: the order of the options should be same with the 
original
                 * pg_exttable catalog's fmtopt field.
@@ -178,6 +177,11 @@ formatOptionsToTextDatum(List *options, char formattype)
                        char       *key = defel->defname;
                        char       *val = (char *) defGetString(defel);
 
+                       if (isfirst)
+                               isfirst = false;
+                       else
+                               appendStringInfo(&cfbuf, " ");
+
                        appendStringInfo(&cfbuf, "%s '%s'", key, val);
                }
        }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to