Index: src/bin/psql/print.c
===================================================================
RCS file: /cvsroot/pgsql/src/bin/psql/print.c,v
retrieving revision 1.105
diff -c -c -r1.105 print.c
*** src/bin/psql/print.c	17 May 2008 21:40:44 -0000	1.105
--- src/bin/psql/print.c	17 May 2008 23:32:36 -0000
***************
*** 1912,1924 ****
  PageOutput(int lines, unsigned short int pager)
  {
  	/* check whether we need / can / are supposed to use pager */
! 	if (pager
! #ifndef WIN32
! 		&&
! 		isatty(fileno(stdin)) &&
! 		isatty(fileno(stdout))
! #endif
! 		)
  	{
  		const char *pagerprog;
  		FILE	   *pagerpipe;
--- 1912,1918 ----
  PageOutput(int lines, unsigned short int pager)
  {
  	/* check whether we need / can / are supposed to use pager */
! 	if (pager && isatty(fileno(stdin)) && isatty(fileno(stdout)))
  	{
  		const char *pagerprog;
  		FILE	   *pagerpipe;
Index: src/interfaces/libpq/fe-print.c
===================================================================
RCS file: /cvsroot/pgsql/src/interfaces/libpq/fe-print.c,v
retrieving revision 1.75
diff -c -c -r1.75 fe-print.c
*** src/interfaces/libpq/fe-print.c	1 Jan 2008 19:46:00 -0000	1.75
--- src/interfaces/libpq/fe-print.c	17 May 2008 23:32:36 -0000
***************
*** 147,159 ****
  
  		if (fout == NULL)
  			fout = stdout;
! 		if (po->pager && fout == stdout
! #ifndef WIN32
! 			&&
! 			isatty(fileno(stdin)) &&
! 			isatty(fileno(stdout))
! #endif
! 			)
  		{
  			/*
  			 * If we think there'll be more than one screen of output, try to
--- 147,154 ----
  
  		if (fout == NULL)
  			fout = stdout;
! 		if (po->pager && fout == stdout && isatty(fileno(stdin)) &&
! 			isatty(fileno(stdout)))
  		{
  			/*
  			 * If we think there'll be more than one screen of output, try to
