pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pepe TD Vo <pepevo@yahoo.com>
To: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: Scott Ribe <scott_ribe@elevated-dev.com>
Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: insert aborted commands ignored
Date: Fri, 1 Feb 2019 13:20:50 +0000 (UTC)
Message-ID: <232412720.1359751.1549027250299@mail.yahoo.com> (raw)
In-Reply-To: <871s4sa63w.fsf@news-spur.riddles.org.uk>
References: <1861353148.992207.1548962087385.ref@mail.yahoo.com>
	<1861353148.992207.1548962087385@mail.yahoo.com>
	<49E280F0-7021-4FD7-AA99-985A86FA899C@elevated-dev.com>
	<2031259937.990023.1548963344432@mail.yahoo.com>
	<5D93F164-7317-43F6-B685-362779757250@elevated-dev.com>
	<729416431.1006652.1548963751866@mail.yahoo.com>
	<B83DF2D4-A966-4C64-813E-C04340D8A93F@elevated-dev.com>
	<524354657.997228.1548963965240@mail.yahoo.com>
	<3842423F-D68D-4BD3-AB34-7508B01B2A9C@elevated-dev.com>
	<1225497522.1016680.1548965545454@mail.yahoo.com>
	<8004E05B-CAFA-4620-8E10-09A796064C9B@elevated-dev.com>
	<677786735.1029265.1548966193847@mail.yahoo.com>
	<C301F965-CFAC-41D3-BE75-9D5D2F6953CE@elevated-dev.com>
	<890332297.1033268.1548966904362@mail.yahoo.com>
	<871s4sa63w.fsf@news-spur.riddles.org.uk>

thank you for your tip.I ran a insert.sql again with AN_ERROR_STOP=1 and output to insert.txt, I get:ERROR: insert or update on table "cidr_ds_roles" violates foreign key constraint "cidr_ds_roles_cidr_roles_fk1"DETAIL: key (role_id)=(3) is not present in table "cidr_roles"
from insert.txt I get INSERT 0 1 (repeat for the rest of insert)
thank you. Bach-Nga

No one in this world is pure and perfect.  If you avoid people for their mistakes you will be alone. So judge less, love and forgive more.To call him a dog hardly seems to do him justice though in as much as he had four legs, a tail, and barked, I admit he was, to all outward appearances. But to those who knew him well, he was a perfect gentleman (Hermione Gingold)
**Live simply **Love generously **Care deeply **Speak kindly.*** Genuinely rich *** Faithful talent *** Sharing success 

    On Thursday, January 31, 2019 4:09 PM, Andrew Gierth <andrew@tao11.riddles.org.uk> wrote:
 

 >>>>> "Pepe" == Pepe TD Vo <pepevo@yahoo.com> writes:

 Pepe> here how I run the script
 Pepe> $ psql -U postgres -d CIDR < insert.sql > insert_cidrmgmt.txt

psql -v ON_ERROR_STOP=1 -U postgres -d CIDR < insert.sql > insert_cidrmgmt.txt

That tells psql to stop on the first error, so you'll be able to see
what the real error was.

Your .txt file does not capture the error because you redirected only
stdout, and errors go to stderr instead.

-- 
Andrew (irc:RhodiumToad)



   

view thread (24+ messages)  latest in thread

Message-ID: <232412720.1359751.1549027250299@mail.yahoo.com>
Permalink:  ../232412720.1359751.1549027250299@mail.yahoo.com/
Also on:    postgresql.org/message-id/232412720.1359751.1549027250299@mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: pepevo@yahoo.com, andrew@tao11.riddles.org.uk, scott_ribe@elevated-dev.com, pgsql-admin@lists.postgresql.org
  Subject: Re: insert aborted commands ignored
  In-Reply-To: <232412720.1359751.1549027250299@mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox