]> granicus.if.org Git - postgresql/commitdiff
psql: Improve unaligned expanded output for zero rows
authorPeter Eisentraut <peter_e@gmx.net>
Sat, 9 Feb 2013 05:05:27 +0000 (00:05 -0500)
committerPeter Eisentraut <peter_e@gmx.net>
Sat, 9 Feb 2013 05:11:58 +0000 (00:11 -0500)
This used to erroneously print an empty line.  Now it prints nothing.

src/bin/psql/print.c

index 2aa313407ef163769a45e5bd444b96c6892eda45..0722c984a8261f130d2ab8f983369c9c09701abe 100644 (file)
@@ -439,10 +439,13 @@ print_unaligned_vertical(const printTableContent *cont, FILE *fout)
                }
 
                /* see above in print_unaligned_text() */
-               if (cont->opt->recordSep.separator_zero)
-                       print_separator(cont->opt->recordSep, fout);
-               else
-                       fputc('\n', fout);
+               if (need_recordsep)
+               {
+                       if (cont->opt->recordSep.separator_zero)
+                               print_separator(cont->opt->recordSep, fout);
+                       else
+                               fputc('\n', fout);
+               }
        }
 }