Re: \d output to a file

From: Tom Lane
Subject: Re: \d output to a file
Date: ,
Msg-id: 2441.1103129458@sss.pgh.pa.us
(view: Whole thread, Raw)
In response to: Re: \d output to a file  (Geoffrey)
Responses: Re: \d output to a file  (Kretschmer Andreas)
Re: [PERFORM] \d output to a file  (Ragnar Hafstað)
List: pgsql-novice

Tree view

\d output to a file  (sarlav kumar, )
 Re: [despammed] \d output to a file  (Andreas Kretschmer, )
  Re: [despammed] \d output to a file  (Geoffrey, )
   Re: [despammed] \d output to a file  (Kretschmer Andreas, )
 Re: \d output to a file  (Geoffrey, )
  Re: \d output to a file  (Tom Lane, )
   Re: \d output to a file  (Kretschmer Andreas, )
   Re: [PERFORM] \d output to a file  (Ragnar Hafstað, )
 Re: [PERFORM] \d output to a file  (Gary Cowell, )
 Re: [PERFORM] \d output to a file  (Grega Bremec, )

Geoffrey <> writes:
> sarlav kumar wrote:
>> I would like to write the output of the \d command on all tables in a
>> database to an output file.

> What is the OS?  On any UNIX variant you can do:
> echo '\d' | psql > outputfile

Or use \o:

regression=# \o zzz1
regression=# \d
regression=# \o
regression=# \d
             List of relations
 Schema |     Name      | Type  |  Owner
--------+---------------+-------+----------
 public | pg_ts_cfg     | table | postgres
 public | pg_ts_cfgmap  | table | postgres
 public | pg_ts_dict    | table | postgres
 public | pg_ts_parser  | table | postgres
 public | t_test        | table | postgres
 public | test_tsvector | table | postgres
(6 rows)

regression=# \q
$ cat zzz1
             List of relations
 Schema |     Name      | Type  |  Owner
--------+---------------+-------+----------
 public | pg_ts_cfg     | table | postgres
 public | pg_ts_cfgmap  | table | postgres
 public | pg_ts_dict    | table | postgres
 public | pg_ts_parser  | table | postgres
 public | t_test        | table | postgres
 public | test_tsvector | table | postgres
(6 rows)

$

            regards, tom lane


pgsql-novice by date:

From: Lola Lee
Date:
Subject: Re: Can't Access Pgsql 7.4.3 in phpPgAdmin on Mac OS X
From: John DeSoi
Date:
Subject: Re: Can't Access Pgsql 7.4.3 in phpPgAdmin on Mac OS X