pg-psql-fixes.patch

text/plain

Filename: pg-psql-fixes.patch
Type: text/plain
Part: 0
Message: some psql table output flaws

Patch

Format: unified
File+
src/bin/psql/print.c 9 5
diff --git a/src/bin/psql/print.c b/src/bin/psql/print.c
index 2a34fb3..0722c98 100644
--- a/src/bin/psql/print.c
+++ b/src/bin/psql/print.c
@@ -439,10 +439,13 @@ static void IsPagerNeeded(const printTableContent *cont, const int extra_lines,
 		}
 
 		/* 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);
+		}
 	}
 }
 
@@ -1169,7 +1172,8 @@ static void IsPagerNeeded(const printTableContent *cont, const int extra_lines,
 	if (cont->cells[0] == NULL && cont->opt->start_table &&
 		cont->opt->stop_table)
 	{
-		fprintf(fout, _("(No rows)\n"));
+		if (!opt_tuples_only)
+			fprintf(fout, _("(No rows)\n"));
 		return;
 	}