Re: Does psql -f quit insertion after an error in a statement has been detected?

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: "Wang, Mary Y" <mary(dot)y(dot)wang(at)boeing(dot)com>
Cc: Vick Khera <vivek(at)khera(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Does psql -f quit insertion after an error in a statement has been detected?
Date: 2010-06-07 21:19:11
Message-ID: 4C0D624F.1070208@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 06/07/2010 02:10 PM, Wang, Mary Y wrote:
> That's good to know. I ended up manually copy/paste INSERT statements for each table to another file and rerun the psql -f again. It was painful!
>
> Mary

For future reference you could do something like:

pg_dump -a -t table_name -f table_name_data.sql

This will dump the data only from the table 'table_name' in the original
database to a file you can use to populate the table in the new database.

See here for the gory details:
http://www.postgresql.org/docs/8.4/interactive/app-pgdump.html

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Greg Stark 2010-06-07 21:33:08 Re: BUG #5492: Query performs slowly and sequence corrupted
Previous Message Bruce Momjian 2010-06-07 21:12:28 Re: Misplaced pg_upgrade_support.so ?