Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sK2Tw-00819V-OH for pgsql-general@arkaria.postgresql.org; Wed, 19 Jun 2024 21:04:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sK2Sv-007D1x-TY for pgsql-general@arkaria.postgresql.org; Wed, 19 Jun 2024 21:03:38 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sK2Sv-007D01-Hl for pgsql-general@lists.postgresql.org; Wed, 19 Jun 2024 21:03:38 +0000 Received: from fhigh2-smtp.messagingengine.com ([103.168.172.153]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sK2St-0028fe-RY for pgsql-general@postgresql.org; Wed, 19 Jun 2024 21:03:37 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 434721140081; Wed, 19 Jun 2024 17:03:34 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 19 Jun 2024 17:03:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1718831014; x=1718917414; bh=r/qTjB8zIlfMiixbIXjwYm3tjRr2MYkrZoVnB0sAbxg=; b= jEC9rIKaEErFkpGXlpTsKRljNAgRHtX2GVbv3PNiiX4t6EWs+ePYAM6pQWziWMWb fqZt6dme4xIVLutd1iNtfzj1SgLAeIJwN87T0KD/UNh7KN+Pk0nCMCEB8jC/+jzU Ax9GUSdZpInQSKyiuo5VxinFex5VzgnXjncvIwYxh1CbGBXaLwor+XeJ3hUrpQeZ 4T4oKYjReWp917Z06ik/jh+iQlYEBzVoKNJfu0mOMp09Ri1JpptEztEABLtNMPHj NM7L7jtAuUj6cAFigsofSqqr3dN0Jx+oGY9coHaUP+HeZIKf6u4CukPV1FvM6R8a Gz8Tm3JxoMQ74r10f11f6g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1718831014; x= 1718917414; bh=r/qTjB8zIlfMiixbIXjwYm3tjRr2MYkrZoVnB0sAbxg=; b=U kRIaVHZTkpsYeZquL7cKPBsHMq0I1nf8efAyaAAfL0lkHmRTUuVSEbePK+kdiLux 9czKgMZfJ89xncLQN6w1H0JBig62ghy8sc56vzmKmhn2HHn+TrHSPiUyAeYqsIh/ g8iCM+7Z27V4xN6C4CcBEw1H5CbwCvPixJ7cjt8lvHV/Zj3f9azNX7wCsNfoIucp w/gp/p8hqGPbwfrr232YSKZBMZ2sI7jTP496zf1/mSnkAITvmxDjAi9YRzPf7SkE 2Zt2k8nRVU5RaLn9B0Beg/M3FZAmydwd2fZdzInTV35IEWt1UKGHRbUwPxYtU7w4 zbexatN4CBmdXsZZOQt6A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeeftddgudehhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfhfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeetughr ihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtg homheqnecuggftrfgrthhtvghrnhepiedvhfeiheehgeeuieeljeeitedtjeehudegfeel kedvleekhedtgfeiffefkedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 19 Jun 2024 17:03:33 -0400 (EDT) Message-ID: <039e657e-5dbc-4243-8c82-865ccb2c2fe5@aklaver.com> Date: Wed, 19 Jun 2024 14:03:33 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Transaction issue To: Rich Shepard , pgsql-general@postgresql.org References: <65F95FD4-CBEA-4E66-AE63-EBC9F617C988@gmail.com> <7678da90-521-3b52-4bb5-11bc9bdf6d1@appl-ecosys.com> Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 6/19/24 13:54, Rich Shepard wrote: > On Wed, 19 Jun 2024, Adrian Klaver wrote: > >> Looks to me you have a left over unresolved transaction in your psql >> session. The easiest solution if that is the case is to exit the >> session and start a new session to run the script. > > Adrian, et al.: > > That's what I've done. This time I commented out the BEGIN; line: > bustrac=# \i insert-law-offices-addr.sql INSERT 0 66 > > There are no errors in the file but when I tried running it as a > transaction > it failed. > > I have not before used transactions when inserting or updating tables; I'm > surprised that starting the transaction from the psql command line chokes > the attempt. It shouldn't: cat transaction_test.sql BEGIN; insert into transaction_test values(1, 'test'), (2, 'dog'), (3, 'cat'); test=# create table transaction_test(id integer, fld_1 varchar); test=# \i transaction_test.sql BEGIN INSERT 0 3 test=*# commit ; COMMIT test=# select * from transaction_test ; id | fld_1 ----+------- 1 | test 2 | dog 3 | cat (3 rows) > > Regards, > > Rich > > > -- Adrian Klaver adrian.klaver@aklaver.com