Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y5kNJ-0004S4-C7 for pgsql-general@arkaria.postgresql.org; Tue, 30 Dec 2014 00:09:25 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Y5kNI-0000tw-Qf for pgsql-general@arkaria.postgresql.org; Tue, 30 Dec 2014 00:09:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y5kNG-0000qo-Dl for pgsql-general@postgresql.org; Tue, 30 Dec 2014 00:09:22 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y5kND-0006Fs-Aj for pgsql-general@postgresql.org; Tue, 30 Dec 2014 00:09:21 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id D03BD2082D for ; Mon, 29 Dec 2014 19:09:17 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute3.internal (MEProxy); Mon, 29 Dec 2014 19:09:17 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=aklaver.com; h= x-sasl-enc:message-id:date:from:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; s=mesmtp; bh=8jAsbOQ9QqeDnImnoiGJYmFLx3c=; b=jbG0DqHurjS7vwTfz6 F+nwV5suMYzz7H2DXjyr5m5NpR37onkhCuB3WoJrcHDKoiOYYwdikCu3G+1Bs4bD DTg2WScaHWTDTw9vd7HDCIBNGlzxRU+4S3diMcHvJvdRVmyl2wjHxZ35EbBIk6fY C/rjkmF5OE97MEGAfo44GTVK0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:message-id:date:from :mime-version:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding; s=smtpout; bh=8jAsbOQ9QqeDnImnoiGJYm FLx3c=; b=SxP5AEVuz+Dg7l1eS0BgE9SwuWlgN28I0S8Rw0v9AMAbgrT8xN6VgX afIKuoGQ/GR+kXbeg1JV2DuRsuKpAfxTBMmvhh9gp1DhBpmluPwaAEqKjMQXFVDI OiU8vhQm/DxM9R3By2G4Kdut7MeKGpMool9ueqUFTQ3K6ZnwzzIuY= X-Sasl-enc: 6+Yv9xSf9wvJlkbO1tKeH0W87WIi5v8z2AICsfDvGzDO 1419898157 Received: from [192.168.1.2] (unknown [174.21.251.95]) by mail.messagingengine.com (Postfix) with ESMTPA id 45D07680114; Mon, 29 Dec 2014 19:09:17 -0500 (EST) Message-ID: <54A1ED2C.2070701@aklaver.com> Date: Mon, 29 Dec 2014 16:09:16 -0800 From: Adrian Klaver User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: David Johnston CC: "pgsql-general@postgresql.org" , "pgsql-bugs@postgresql.org" Subject: Re: Rollback on include error in psql References: <54A01E44.9050105@aklaver.com> <54A06C58.2020009@aklaver.com> <1419815044308-5832233.post@n5.nabble.com> <54A17800.1010700@aklaver.com> <54A183C5.1080500@aklaver.com> <54A18A25.50303@aklaver.com> <54A1D0BA.4080609@aklaver.com> <54A1D7BF.3060300@aklaver.com> <54A1E5F6.2000100@aklaver.com> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org On 12/29/2014 03:56 PM, David Johnston wrote: > > > > > ​So you think psql should issue "COMMIT;" even if it is exiting due to > "ON_ERROR_STOP"? I say yes, if it is a non-SQL error. As Viktor stated, SQL errors abort the transaction. > > Whether you do or don't can you show me where in the documentation the > current behavior is described? Your biggest issue seems to be with --single-transaction and ON_ERROR_STOP so: --single-transaction When psql executes a script, adding this option wraps BEGIN/COMMIT around the script to execute it as a single transaction. Therefore: BEGIN; script COMMIT; I would and have agreed with your previous statements that it is not clear enough that \i is not an SQL command and an error with same is ignored by the transaction. Outside of that I see no problem. > > ​David J.​ > -- Adrian Klaver adrian.klaver@aklaver.com -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general