Re: Simpler dump?

From: "Uwe C(dot) Schroeder" <uwe(at)oss4u(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: Ted Byers <r(dot)ted(dot)byers(at)rogers(dot)com>
Subject: Re: Simpler dump?
Date: 2007-12-10 05:44:44
Message-ID: 200712092144.44494.uwe@oss4u.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


pg_dump -x -O -s [databasename] > outfile.sql

HTH
Uwe

On Sunday 09 December 2007, Ted Byers wrote:
> Is there a way to tell pg_dump to just dump the SQL
> statements required to create the tables, sequences,
> indeces, keys, &c.? I DON'T need to restore or
> recreate things like users, or most other kinds of DB
> objects. Just routine DDL statements. Looking
> through a dump file for a small database, it looks
> like pg_dump is serious overkill, dumping a lot of
> stuff I don't need (since I'm just using defaults for
> them anyway).
>
> I am developing a new DB app, to be deployed on a web
> based host on the other side of the planet. There is,
> at present, no 'data', and the only information to be
> transferred consists of the various tables, indeces,
> &c. I am creating.
>
> Obviously, we don't want to put any of my test data on
> a server that will in due course be the production
> host, when the app goes live (so once my colleagues on
> the other side of the planet have had a chance to play
> with what I've developed, we'll mostly empty the DB of
> test data, except for a small amount of data we've
> obtained). I expect that a few tiny csv files I have
> here will be ftped to the host and we'd use a simple
> script to bulk load that. Another fly in the ointment
> is that the hosting company is still using v 8.1.9 and
> I am using 8.2.5 on my machine, so I am concerned that
> a regular dump and restore may be problematic: it
> hasn't worked so far, but then I've spent much of my
> time so far wrestling with phppgadmin. :-(
>
> I'm just looking for something that will save me a
> little time. I've created the core of the DB already
> on my development machine, using pgAdmin, but I can
> recreate it in about a day using Emacs to create a SQL
> script that preproduces what I did in pgAdmin.
>
> Any information would be appreciated.
>
> Thanks
>
> Ted
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend

--
UC

--
Open Source Solutions 4U, LLC 1618 Kelly St
Phone: +1 707 568 3056 Santa Rosa, CA 95401
Cell: +1 650 302 2405 United States
Fax: +1 707 568 6416

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-12-10 05:48:19 Re: Simpler dump?
Previous Message Ted Byers 2007-12-10 05:33:47 Simpler dump?