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 1sK2Rw-0080zx-8C for pgsql-general@arkaria.postgresql.org; Wed, 19 Jun 2024 21:02:36 +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 1sK2Ru-0079Sv-1i for pgsql-general@arkaria.postgresql.org; Wed, 19 Jun 2024 21:02:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sK2Rt-0079Sn-N3 for pgsql-general@lists.postgresql.org; Wed, 19 Jun 2024 21:02:34 +0000 Received: from mail-oa1-x2f.google.com ([2001:4860:4864:20::2f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sK2Rs-002X75-GG for pgsql-general@postgresql.org; Wed, 19 Jun 2024 21:02:34 +0000 Received: by mail-oa1-x2f.google.com with SMTP id 586e51a60fabf-25cba5eea69so43530fac.2 for ; Wed, 19 Jun 2024 14:02:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718830950; x=1719435750; darn=postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=cYKGosECi8sVUtlh6YUFJalo8NfXP7+Z04dy4lBGXkA=; b=HRwkhaxJ3bhvgt2X4ow4T1OMA5mzml3G9TKVgoLI/7d5ytgM/dXJpa5+K0ghPIZ63U GhltvT3y5dZmA4VHkqh/DR8KHaQ1SFiZ4jcXGZbe+BsA6icGve8NFwpsDKeH/uHOnaPu Auqk3h2r55Id+gdm27h+fryydi1vu/dEoYgDGPUyCb1siPkd2q8usxki/KDGk//FtXCi 63Ry+IjK/3+EMWhqlc9bUgwwcGe5ikLx85IuPSewvlwYnCAXM0KaIehd5zPtZGLinJad Zolm5HuEAZe6VTYyoMVbw6Kx0RmE4b0aVKVkAVFdAsUhtOPLZJ3qiFdHD4ekSGoaAH1o d3MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718830950; x=1719435750; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cYKGosECi8sVUtlh6YUFJalo8NfXP7+Z04dy4lBGXkA=; b=xMALniszJ8tNcChGIr4zYZJ1c8F2FYcskBMabBOOARMvpn1w0yBZz8DqhDQbAuJgQi HWOrs3diMoZ6pK8ZvFfNiFgJc0KhZ0bA8E4qpcudV43EBGV5VEN8gqLSBetu6FVJ9b8e xXIOKCzP9g1WS9cDHUAvoeflNTD4L4uSN1yKEmrTtmAmtw1R8Rc+e9JKZ80R18F1h8gk wNY4zp7zDJFvNxqH/zW91Zolk2b0qh/ZQjBbjiJr3fFZl266xGFZJWUkYl4EMYqigatx CDyznO68LLZ4Bdj60Af4mg6qZhxSyQQKAO9cwomfdUR003ebplmdsETmfjdR4QXLhMY/ iDsg== X-Gm-Message-State: AOJu0YwvBiCKnZ7/wW/BhbIKcrsHVgy86/gMg+dEevVFwmBSk19KNrKt O+e+awBT0Xb3nHmUyuwaPxjuQbrJ8blqQdGx5gKndkPrD+U8FNopPgWlSelJBZcHciRpavslRKT vijnSMR2CQ95k7SqQUoGiROwRd+7HHQ== X-Google-Smtp-Source: AGHT+IG8eZhD/GfC85k/ALvNxck+9w4Ky7RqJg4nzZ63eAKv53IyQLpFfrC2tiMtRKPZDznzokEr38VDbrOzHPvX/xE= X-Received: by 2002:a05:6870:ac1e:b0:254:76c6:bb20 with SMTP id 586e51a60fabf-25c94d709cbmr3478973fac.51.1718830950033; Wed, 19 Jun 2024 14:02:30 -0700 (PDT) MIME-Version: 1.0 References: <65F95FD4-CBEA-4E66-AE63-EBC9F617C988@gmail.com> <7678da90-521-3b52-4bb5-11bc9bdf6d1@appl-ecosys.com> In-Reply-To: From: Ron Johnson Date: Wed, 19 Jun 2024 17:02:19 -0400 Message-ID: Subject: Re: Transaction issue To: pgsql-general Content-Type: multipart/alternative; boundary="00000000000034b29a061b448448" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000034b29a061b448448 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jun 19, 2024 at 4:54=E2=80=AFPM 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=3D# \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 doesn't. The rest of us have successfully done it before. You're Doing *Something* Wrong. Don't know what, but you're doing it. Happens to *ALL OF US*, and is why "\echo all" and "psql -a" were developed. So we can see WTH we screwed up, and then fix it. --00000000000034b29a061b448448 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Jun 19, 2024 at 4:54=E2=80=AFPM R= ich Shepard <rshepard@appl-e= cosys.com> wrote:
On Wed, 19 Jun 2024, Adrian Klaver wrot= e:

> Looks to me you have a left over unresolved transaction in your psql s= ession.
> The easiest solution if that is the case is to exit the session and st= art 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=3D# \i insert-law-offices-addr.sql
INSERT 0 66

There are no errors in the file but when I tried running it as a transactio= n
it failed.

I have not before used transactions when inserting or updating tables; I= 9;m
surprised that starting the transaction from the psql command line chokes the attempt.
=C2=A0
It doesn't.=C2=A0 Th= e rest of us have successfully done it before.=C2=A0 You're Doing So= mething=C2=A0Wrong.=C2=A0 Don't know what, but you're doing it.= Happens to ALL OF US, and is why "\ec= ho all" and "psql -a"= were developed.

So we can see WTH=C2=A0we screwed= up, and then fix it.

--00000000000034b29a061b448448--