Re: Simpler dump?

From: Ted Byers <r(dot)ted(dot)byers(at)rogers(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Simpler dump?
Date: 2007-12-10 13:11:15
Message-ID: 88635.70964.qm@web88313.mail.re4.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


--- Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Ted Byers <r(dot)ted(dot)byers(at)rogers(dot)com> writes:
> > Is there a way to tell pg_dump to just dump the
> SQL
> > statements required to create the tables,
> sequences,
> > indeces, keys, &c.?
>
> pg_dump -s ?
>

Thanks Tom

> > I DON'T need to restore or
> > recreate things like users, or most other kinds of
> DB
> > objects. Just routine DDL statements.
>
> pg_dump doesn't try to recreate users, and to most
> people "DDL" would
> include the creation commands for any type of DB
> object whatsoever.
> Your demarcation between stuff you want and stuff
> you don't seems far
> too vaguely stated.
>
Sorry,

I just wanted the statements I need to recreate the
tables, sequences and constraints I created. When I
create a database, I leave the default public schema
alone. The tables, etc. I add are placed in a
separate schema. It seems the public schema is
automagically created by Postgres every time I create
a new database on a given server, and it has over a
dozen types, over 400 functions, &c. I don't really
understand why it needs to be duplicated in every Db
on a server, but that is another matter. In my
database, so far I have only created a dozen sequences
and two dozen tables, along with a suite of
constraints. So when I look at the dump file, out of
6833 lines of SQL, the first 5744 relate to the
default public schema and only the last 1100 relate to
DB objects I'd created. I'd assume that the public
schema would be created with the usual stuff when I
create the database name on the production host
anyway, so why recreate all that in the dump file?

Thanks again,

Ted

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tino Wildenhain 2007-12-10 13:16:22 Re: Simpler dump?
Previous Message Ted Byers 2007-12-10 12:59:44 Re: Simpler dump?