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 1gpJaQ-0001cw-Gu for pgsql-admin@arkaria.postgresql.org; Thu, 31 Jan 2019 21:09:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gpJaN-00014o-SE for pgsql-admin@arkaria.postgresql.org; Thu, 31 Jan 2019 21:09:23 +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 1gpJaN-00014h-Kn for pgsql-admin@lists.postgresql.org; Thu, 31 Jan 2019 21:09:23 +0000 Received: from lungold.riddles.org.uk ([82.68.208.19]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gpJaL-0001ad-JD for pgsql-admin@lists.postgresql.org; Thu, 31 Jan 2019 21:09:22 +0000 Received: from [192.168.127.1] (port=41221 helo=caithnard.riddles.org.uk) by lungold.riddles.org.uk with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.88 (FreeBSD)) (envelope-from ) id 1gpJaJ-0007nH-JL; Thu, 31 Jan 2019 21:09:19 +0000 Received: from [127.0.0.1] (port=47163 helo=caithnard.riddles.org.uk) by caithnard.riddles.org.uk with esmtp (Exim 4.89 (FreeBSD)) (envelope-from ) id 1gpJaI-000EDt-UF; Thu, 31 Jan 2019 21:09:19 +0000 From: Andrew Gierth To: Pepe TD Vo Cc: Scott Ribe , Pgsql-admin Subject: Re: insert aborted commands ignored In-Reply-To: <890332297.1033268.1548966904362@mail.yahoo.com> (Pepe TD Vo's message of "Thu, 31 Jan 2019 20:35:04 +0000 (UTC)") Message-ID: <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> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (berkeley-unix) X-Mayan-Date: Long count = 13.0.6.3.12; tzolkin = 13 Eb; haab = 5 Pax Date: Thu, 31 Jan 2019 21:09:18 +0000 MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk >>>>> "Pepe" == 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=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)