From: Tom Lane <tgl@sss.pgh.pa.us>
To: Geoffrey <esoteric@3times25.net>
Cc: pgsqlnovice <pgsql-novice@postgresql.org>
Cc: pgsqlperform <pgsql-performance@postgresql.org>
Subject: Re: \d output to a file
Date: Wed, 15 Dec 2004 11:50:58 -0500
Message-ID: <2441.1103129458@sss.pgh.pa.us> (raw)
In-Reply-To: <41C05576.7030703@3times25.net>
References: <20041215143822.37534.qmail@web51304.mail.yahoo.com>
<41C05576.7030703@3times25.net>
Geoffrey <esoteric@3times25.net> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, esoteric@3times25.net, pgsql-novice@postgresql.org
Subject: Re: \d output to a file
In-Reply-To: <2441.1103129458@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox