Re: Dumping table definitions - Mailing list pgsql-sql

FromDawid Kuroczko
SubjectRe: Dumping table definitions
Date
Msg-id[email protected]
Whole thread Raw
In response toDumping table definitions  ("Mark Fenbers" <[email protected]>)
Listpgsql-sql
On 7/18/05, Mark Fenbers <[email protected]> wrote:
> 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 is your friend!  Use option -s (--schema-only).
It will dump the information you want. :-)
 Regards,   Dawid


pgsql-sql by date:

Previous
From: "Jim Buttafuoco"
Date:
Subject: Re: Dumping table definitions
Next
From: "Andy"
Date:
Subject: Re: Create trigger for auto update function