Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gpYkg-0001y6-KT for pgsql-admin@arkaria.postgresql.org; Fri, 01 Feb 2019 13:21:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gpYkf-0007Mu-Bw for pgsql-admin@arkaria.postgresql.org; Fri, 01 Feb 2019 13:21:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gpYke-0007Mm-UI for pgsql-admin@lists.postgresql.org; Fri, 01 Feb 2019 13:21:01 +0000 Received: from sonic302-3.consmr.mail.bf2.yahoo.com ([74.6.135.42]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gpYka-0007pi-IL for pgsql-admin@lists.postgresql.org; Fri, 01 Feb 2019 13:20:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1549027254; bh=Zqrz+XcQi/jtRISZul/cnUmUN2qo5LYwzST4N+xSl18=; h=Date:From:Reply-To:To:Cc:In-Reply-To:References:Subject:From:Subject; b=XUFagr8MSTXJSGEATJOGycI8XWO62LiyirfxgofDRXLieIs+P9gUgyJXicwxMsXX/0LfxRSxouETA3B/ggpQKHf7MckfRaY/sDjTJCekHkL49iWoPtti+qVNMeawmMZWrbbSkyJzkKJleVWIzrk4XBVPxqrCaV9bmgQU7JnN6m5UcIfI6ZnRzHgmW18erPKsM3JhMGVP792ai2jYDpHBcB3HoccFbwoZIx2ah/adf2NnJJzsCDHkMYJ4MkWgqS0dqcMYdjeBtp7+F9C9d//l6ywul+Pws2OjfIV0AAPSVfjrkFVe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lrnyp6fldJSgUAqCMEoopaaNkhOqxDYtmWLcIyUl ESphkRcd4kVl5138lialHOUREe3I_9GArXDEPT.a32qyLvuQWobh94dREzdt_2ya4jOfrFj4- Received: from sonic.gate.mail.ne1.yahoo.com by sonic302.consmr.mail.bf2.yahoo.com with HTTP; Fri, 1 Feb 2019 13:20:54 +0000 Date: Fri, 1 Feb 2019 13:20:50 +0000 (UTC) From: Pepe TD Vo Reply-To: Pepe TD Vo To: Andrew Gierth Cc: Scott Ribe , Pgsql-admin Message-ID: <232412720.1359751.1549027250299@mail.yahoo.com> 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> <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> <890332297.1033268.1548966904362@mail.yahoo.com> <871s4sa63w.fsf@news-spur.riddles.org.uk> Subject: Re: insert aborted commands ignored MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1359750_870695245.1549027250297" X-Mailer: WebService/1.1.13027 YahooMailNeo Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36 Content-Length: 6695 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------=_Part_1359750_870695245.1549027250297 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable thank you for your tip.I ran a insert.sql again with AN_ERROR_STOP=3D1 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)=3D(3) is not present in table "cidr_roles" from insert.txt I get=C2=A0INSERT 0 1 (repeat for the rest of insert) thank you.=C2=A0Bach-Nga No one in this world is pure and perfect.=C2=A0 If you avoid people for the= ir 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 t= o 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=20 On Thursday, January 31, 2019 4:09 PM, Andrew Gierth wrote: =20 >>>>> "Pepe" =3D=3D Pepe TD Vo writes: Pepe> here how I run the script Pepe> $ psql -U postgres -d CIDR < insert.sql > insert_cidrmgmt.txt psql -v ON_ERROR_STOP=3D1 -U postgres -d CIDR < insert.sql > insert_cidrmgm= t.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. --=20 Andrew (irc:RhodiumToad) =20 ------=_Part_1359750_870695245.1549027250297 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
thank you for your tip.<= /span>
<= span id=3D"yui_3_16_0_ym19_1_1549025568720_14130">I ran a insert.sql again = with AN_ERROR_STOP=3D1 and output to insert.txt, I get:
ERROR: insert or update on table "cidr_ds_ro= les" violates foreign key constraint "cidr_ds_roles_cidr_roles_fk1"<= /div>
DETAIL: key (role_id)=3D(3) is n= ot present in table "cidr_roles"

from insert.txt I get =
= INSERT 0 1 (repeat for t= he rest of insert)

thank you.
 
<= /span>
Bach-Nga

No one in = this world is pure and perfect.  If you avoid people for their mistake= s you will be alone. So judge less, love and forgive more.
= To call him a dog hardly seems to do him justice th= ough 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)

<= span style=3D"color:rgb(128, 0, 255);" id=3D"yui_3_13_0_rc_1_1_138178942103= 8_7867">**Live simply **Love generously **Care deeply **Speak kindly.
*** Genuinely rich *** Faithful talent *** Sharing success=


On Th= ursday, January 31, 2019 4:09 PM, Andrew Gierth <andrew@tao11.riddles.or= g.uk> wrote:


<= div dir=3D"ltr">>>>>> "Pepe" =3D=3D Pepe TD Vo <pepevo@yahoo.com> writes:

= Pepe> here how I run the script
Pepe> $ psql -U po= stgres -d CIDR < insert.sql > insert_cidrmgmt.txt
<= br clear=3D"none">psql -v ON_ERROR_STOP=3D1 -U postgres -d CIDR < insert= .sql > insert_cidrmgmt.txt

That tel= ls 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)


=

------=_Part_1359750_870695245.1549027250297--