Re: question about pg_dump -a - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: question about pg_dump -a
Date
Msg-id 20070928131623.GD18001@alvh.no-ip.org
Whole thread Raw
In response to Re: question about pg_dump -a  (Ottavio Campana <ottavio@campana.vi.it>)
Responses Request for feature: pg_dump schema masquerade flag  (Owen Hartnett <owen@clipboardinc.com>)
List pgsql-general
Ottavio Campana wrote:
> Richard Huxton ha scritto:
> > Ottavio Campana wrote:
> >>
> >> Is there a way to export tables in order, so that dependencies are
> >> always met? reading the manpage of pg_dump I found the -Fc flag, but I
> >> haven't understood if it is good for me and how it works. Or is there a
> >> way to relax constraints while loading data?
> >
> > Try a pg_dump with -Fc and then pg_restore --data-only.
> >
> > If all else fails, you can control item-by-item what gets restored by
> > producing a list from pg_restore (--list), commenting out lines and then
> > using it as a specification with (--use-list). See manuals for full
> > details.
>
> with -L I was able to solve it, thanks.
>
> But why does pg_dump does not already exports data such that previous
> tables do not depend on successive ones?

It does -- but it can't with data-only dumps.  (I think that it just
punts and doesn't care.  Maybe we could improve it to do a "best
effort").  The current suggested usage is to avoid using data-only
dumps.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

pgsql-general by date:

Previous
From: Ottavio Campana
Date:
Subject: Re: question about pg_dump -a
Next
From: Owen Hartnett
Date:
Subject: Request for feature: pg_dump schema masquerade flag