Is there a way that I can supress the column heading and the "(# rows)"
which come before and after the following psql command:

psql -e db01 -c "select tablename from pg_tables where tablename NOT
LIKE 'pg%'"


The current output is:

tablename
=======
table1
table2
table3
table4
(4 rows)

What I'd like to get is simply:

table1
table2
table3
table4


Thanks.
-Tony



Thu, 29 Jul 1999 10:02:13 -0700
"G. Anthony Reina" <reina@nsi.edu>
Formatting the output
Try:

psql db01 -c "select tablename from pg_tables where tablename NOT LIKE '%pg%'" -t

The -e makes it display the QUERY: <whatever> line... so removing it fixes that
problem... the -t tells it not to show the column headings and such...

Bill

On Thu, Jul 29, 1999 at 10:02:13AM -0700, G. Anthony Reina wrote:
>Is there a way that I can supress the column heading and the "(# rows)"
>which come before and after the following psql command:
>
>psql -e db01 -c "select tablename from pg_tables where tablename NOT
>LIKE 'pg%'"
>
>
>The current output is:
>
>tablename
>=======
>table1
>table2
>table3
>table4
>(4 rows)
>
>What I'd like to get is simply:
>
>table1
>table2
>table3
>table4
>
>
>Thanks.
>-Tony
>
>
>

-- 
Liam

Bill Brandt                                   
brandtwr@draaw.net                              http://www.draaw.net/

Thu, 29 Jul 1999 13:34:03 -0400
Bill Brandt <brandtwr-pgsql@draaw.net>
Re: [SQL] Formatting the output
> Is there a way that I can supress the column heading and the "(# rows)"
> which come before and after the following psql command:
> 
> psql -e db01 -c "select tablename from pg_tables where tablename NOT
> LIKE 'pg%'"

How about psql -qt:
	
	#$ sql -qt test
	select * from pg_language;
	internal|f      |f           |            0|n/a           
	lisp    |f      |f           |            0|/usr/ucb/liszt
	C       |f      |f           |            0|/bin/cc       
	sql     |f      |f           |            0|postgres      

The manual page says -q turns off row count, but -t does.  I will fix
that now.

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Thu, 29 Jul 1999 13:41:54 -0400 (EDT)
Bruce Momjian <maillist@candle.pha.pa.us>
Re: [SQL] Formatting the output
Thomas, please change the psql manual page to say -t turns off headings
and the row count, and change -q to not mention turning off of row
count, ok?  I believe you are controlling the master manual pages
copies.


-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Thu, 29 Jul 1999 13:43:42 -0400 (EDT)
Bruce Momjian <maillist@candle.pha.pa.us>
Re: [SQL] Formatting the output
Bill Brandt wrote:

> Try:
>
> psql db01 -c "select tablename from pg_tables where tablename NOT LIKE '%pg%'" -t
>
> The -e makes it display the QUERY: <whatever> line... so removing it fixes that
> problem... the -t tells it not to show the column headings and such...
>

Bruce Momjian wrote:

> How about psql -qt:
>
>         #$ sql -qt test
>         select * from pg_language;
>         internal|f      |f           |            0|n/a
>         lisp    |f      |f           |            0|/usr/ucb/liszt
>         C       |f      |f           |            0|/bin/cc
>         sql     |f      |f           |            0|postgres
>
> The manual page says -q turns off row count, but -t does.  I will fix
> that now.
>

Thanks. That works fine.

-Tony



Thu, 29 Jul 1999 11:37:25 -0700
"G. Anthony Reina" <reina@nsi.edu>
Re: [SQL] Formatting the output
> Thomas, please change the psql manual page to say -t turns off headings
> and the row count, and change -q to not mention turning off of row
> count, ok?  I believe you are controlling the master manual pages
> copies.

Sure. Although I forgot to mention it explicitly, I've completed the
merge of the old man page info into the newer sgml pages. From here on
I'm just making small tweaks to get the man page stuff actually
working (have had to dive into perl code to get the cross references
to work).

So, feel free to touch those files yourself if you would like, but let
me know if you want me to do it.

                      - Thomas

-- 
Thomas Lockhart				lockhart@alumni.caltech.edu
South Pasadena, California

Fri, 30 Jul 1999 00:30:38 +0000
Thomas Lockhart <lockhart@alumni.caltech.edu>
Re: [SQL] Formatting the output
> > Thomas, please change the psql manual page to say -t turns off headings
> > and the row count, and change -q to not mention turning off of row
> > count, ok?  I believe you are controlling the master manual pages
> > copies.
> 
> Sure. Although I forgot to mention it explicitly, I've completed the
> merge of the old man page info into the newer sgml pages. From here on
> I'm just making small tweaks to get the man page stuff actually
> working (have had to dive into perl code to get the cross references
> to work).
> 
> So, feel free to touch those files yourself if you would like, but let
> me know if you want me to do it.

No problem.  Done.

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Thu, 29 Jul 1999 20:42:47 -0400 (EDT)
Bruce Momjian <maillist@candle.pha.pa.us>
Re: [SQL] Formatting the output