Re: How to use PG_DUMP?

From: Andre Lopes <lopes80andre(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to use PG_DUMP?
Date: 2010-01-24 18:50:37
Message-ID: 18f98e681001241050j6e0c92b3x9c4b427b637a859f@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I have tested with "pg_dump -u -p 5432 -d -f c:\test.sql mydatabase" but
the order of the INSERTS it is not the correct. What PG_DUMP does is to add
the CONSTRAINTS after doing the INSERTS. There is a way to have the correct
order of the INSERTS?

I have tested the COPY but does not insert nothing.

What can I do?

Best Regards,

On Sun, Jan 24, 2010 at 5:22 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Andre Lopes <lopes80andre(at)gmail(dot)com> writes:
> > I have generated the CREATE statements using a modeling tool, and I have
> > created another database to test the changes. My problem is the order of
> the
> > INSERT statements generated by PG_DUMP [-a -d], causing errors because of
> > the order of the INSERTS.
>
> If you are talking about foreign key constraint failures, the best way
> is to use a regular dump (not -a). pg_dump will order the data and
> constraint creations properly then.
>
> regards, tom lane
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2010-01-24 19:23:22 Re: port question
Previous Message Gauthier, Dave 2010-01-24 18:47:20 Re: Recursion in triggers?