Re: Dumping table definitions

From: "Jim Buttafuoco" <jim(at)contactbda(dot)com>
To: "Mark Fenbers" <Mark(dot)Fenbers(at)noaa(dot)gov>, Pg SQL Discussion Group <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Dumping table definitions
Date: 2005-07-18 16:56:35
Message-ID: 20050718165607.M86774@contactbda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


use pg_dump with the --schema-only and --table= params

---------- Original Message -----------
From: "Mark Fenbers" <Mark(dot)Fenbers(at)noaa(dot)gov>
To: Pg SQL Discussion Group <pgsql-sql(at)postgresql(dot)org>
Sent: Mon, 18 Jul 2005 12:50:54 -0400
Subject: [SQL] Dumping table definitions

> 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
------- End of Original Message -------

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2005-07-18 16:56:47 Re: Dumping table definitions
Previous Message Mark Fenbers 2005-07-18 16:50:54 Dumping table definitions