From: Mark Fenbers <Mark.Fenbers@noaa.gov>
To: Pg SQL Discussion Group <pgsql-sql@postgresql.org>
Subject: Dumping table definitions
Date: Mon, 18 Jul 2005 12:50:54 -0400
Message-ID: <42DBDDEE.3090903@noaa.gov> (raw)
I am looking for a way to reformat the information that is generated from
\d mytable
into SQL syntax, such that the table can be recreated with 'psql -f
mytable.sql' complete with index and constraint definitions. I can do
awk and sed commands to do this if I need to, but first wanted to check
if Pg already had tools to export the table structure (without the
data). Does it?
Also, Is there a way to export the structure of all tables at once
instead of one table at a time?
Mark
Attachments:Mark.Fenbers.vcf (text/x-vcard, 281B) download
begin:vcard
fn:Mark Fenbers
n:Fenbers;Mark
org:DoC/NOAA/NWS/OHRFC
adr:;;1901 South SR 134;Wilmington;OH;45177-9708;USA
email;internet:Mark.Fenbers@noaa.gov
title:Sr. HAS Meteorologist
tel;work:937-383-0430 x246
x-mozilla-html:TRUE
url:http://weather.gov/ohrfc
version:2.1
end:vcard
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-sql@postgresql.org
Cc: Mark.Fenbers@noaa.gov
Subject: Re: Dumping table definitions
In-Reply-To: <42DBDDEE.3090903@noaa.gov>
* 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