Re: Dumping table definitions - Mailing list pgsql-sql

From Tom Lane
Subject Re: Dumping table definitions
Date
Msg-id 13034.1121705807@sss.pgh.pa.us
Whole thread Raw
In response to Dumping table definitions  ("Mark Fenbers" <Mark.Fenbers@noaa.gov>)
List pgsql-sql
"Mark Fenbers" <Mark.Fenbers@noaa.gov> writes:
> 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?

pg_dump with the -s switch is a much better way ...
        regards, tom lane


pgsql-sql by date:

Previous
From: "Mark Fenbers"
Date:
Subject: Dumping table definitions
Next
From: "Jim Buttafuoco"
Date:
Subject: Re: Dumping table definitions