Commit e2cd62c3 authored by Bruce Momjian's avatar Bruce Momjian

In psql, test for output to stdout when forcing pager for wide output.

parent 2413ac97
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Copyright (c) 2000-2008, PostgreSQL Global Development Group * Copyright (c) 2000-2008, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.104 2008/05/17 17:52:14 tgl Exp $ * $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.105 2008/05/17 21:40:44 momjian Exp $
*/ */
#include "postgres_fe.h" #include "postgres_fe.h"
...@@ -634,7 +634,7 @@ print_aligned_text(const printTableContent *cont, FILE *fout) ...@@ -634,7 +634,7 @@ print_aligned_text(const printTableContent *cont, FILE *fout)
} }
/* If we wrapped beyond the display width, use the pager */ /* If we wrapped beyond the display width, use the pager */
if (!is_pager && output_columns > 0 && if (!is_pager && fout == stdout && output_columns > 0 &&
(output_columns < total_header_width || output_columns < width_total)) (output_columns < total_header_width || output_columns < width_total))
{ {
fout = PageOutput(INT_MAX, cont->opt->pager); /* force pager */ fout = PageOutput(INT_MAX, cont->opt->pager); /* force pager */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment