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 1u5fcS-004EaY-2C for pgsql-general@arkaria.postgresql.org; Fri, 18 Apr 2025 06:54: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 1u5fcQ-008FH2-6L for pgsql-general@arkaria.postgresql.org; Fri, 18 Apr 2025 06:54:35 +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 1u5fcP-008FGu-NK for pgsql-general@lists.postgresql.org; Fri, 18 Apr 2025 06:54:34 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u5fcN-000hPe-0W for pgsql-general@postgresql.org; Fri, 18 Apr 2025 06:54:34 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-43ede096d73so10867855e9.2 for ; Thu, 17 Apr 2025 23:54:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1744959271; x=1745564071; darn=postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=2+50nP4jwo/RNuxB5s3U46ez97VVy92nH6K3EjqsONA=; b=Zy/mg/IbleX6+TOJabkScShY2Q6b5EXfJiJLilUiGzYMKdU75liE0G8QC7q7MkaWTi zAHNaWyIgZWqC+VL0ToZOwCALK5YAEUo3LKUg5ecYeu60RCJB0S2NW+pHkV+WlJ2O18j xkcE4lp9GMNbJAAP253r71pPOHzqxF+y1a7FcdsrQVKQm/pa+DfeoGRprmRtzzWmgIER 5qz0Uo1euZ3t1mE6LDDGS9LtZGsZKa+4GAsefrSRAwfnAYcU7u3nUCyQyBn4ymVLd8A7 EgciwkxcumhPnlxEXjdhx0T2INchV6SHTSQesFq3PNlfGqrx36MM+6yWSrjyQIvA07qe Unkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744959271; x=1745564071; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=2+50nP4jwo/RNuxB5s3U46ez97VVy92nH6K3EjqsONA=; b=H90drocck4G1O3VkrJJ/5YC3DfdWgDQ0zLS2kJVysa7pPJglgFWh7SbJUv9JH5zsm6 p9GnlcOYcuoiEEYpog9jNTr8ms+m9gTVxeau/DpXEaqG6TKFJMioFe6CRSIwezGpAQAp AZpvn5LuXOJCuVuo4Jlo2aOqHE8rTiTgvwKoOw2bCqowWbDwQuU2YBXsMpYEgUulruUc Pvp8Rz1PXJsg0mWdU3KHQurpSaN0dCIj5a0PKwBLc09QCGgDekqQ4MyU+R3Wb5yaV2x4 85+xHzpFOVnmiRtEbHzFzKZUrYK0R34/xNooxWZdUPgnk765P95fAjAIuUdl/kGy0nCy 5dag== X-Forwarded-Encrypted: i=1; AJvYcCX1vCkSse7o0BGJ8aKMe7xrL+rSjgKbhcb5Qb+tVBdfpWxcGFzdk1FcZ5XTlrrer7wgTDtzMA8ZMerlNB/T@postgresql.org X-Gm-Message-State: AOJu0Yy46lwsxZiTGp691lCiWvhb3f56lIYSZVvz6VNiuYUyz37ArctI A6X1Ys5xC3nJMk4VamPP/0Apsc2TX2WlSgTZ7ICdVTVPUtufax3tpL1BJONYG3qNCDuATNkY1hd y X-Gm-Gg: ASbGnctLKUrgOc7fyiC63Z7ZfrG18OXEh00myewMD/VW9fGeccMW9df2v6ZhiRqlXu4 5U/toKoJwIf0YmGh1dd+i9qxZm31E161fFbQwCekfllH5GaSRexbe71hN5L3+UAEOIKvMVrm8la KCYazrPNtsWwCzDkx4Xrx5NTcxJ5Jea4qW1BhQdE8/RsyzpPwWy9IoyDfzEEpdftSP7mek9PrGQ GQv3PuPiAGt/y87GkJJiRla7uiaWJCyXivbVNi7hwRZjlR3bIr/xnwjC1PItmX0uWnuysFfa3qv wnOW3Qaqjzx1zDJyA70PUZ6nTlXtBGUz7QD3DmpcfooBzSlzaoLPUmmhQhN3 X-Google-Smtp-Source: AGHT+IHZ3XJQ5qvZsRXkM7r14rCPxcaiQQbT1G+C8GV92POC6o47cjh1El79udKmZ0B8WYlCP2lxTg== X-Received: by 2002:a05:600c:5251:b0:440:61eb:2ce5 with SMTP id 5b1f17b1804b1-4406abb0f9cmr9218265e9.17.1744959270937; Thu, 17 Apr 2025 23:54:30 -0700 (PDT) Received: from localhost.localdomain ([2001:871:5e:5373:9d9a:af04:78c5:75aa]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4406d6db131sm10488115e9.28.2025.04.17.23.54.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Apr 2025 23:54:30 -0700 (PDT) Message-ID: <02e2740edf821e2ce84773c83065b45e9be890cc.camel@cybertec.at> Subject: Re: Error while updating a table From: Laurenz Albe To: "sivapostgres@yahoo.com" , Pgsql-general Date: Fri, 18 Apr 2025 08:54:30 +0200 In-Reply-To: <1385521371.3160626.1744955370756@mail.yahoo.com> References: <1385521371.3160626.1744955370756.ref@mail.yahoo.com> <1385521371.3160626.1744955370756@mail.yahoo.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.3 (3.54.3-1.fc41) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 2025-04-18 at 05:49 +0000, sivapostgres@yahoo.com wrote: > We use PowerBuilder along with PostgreSQL. >=20 > PostgreSQL 15.7 (Ubuntu 15.7-1.pgdg24.04+1) on x86_64-pc-linux-gnu, compi= led by gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0, 64-bit >=20 > Suddenly, one system starts throwing an error while updating a record fro= m PowerBuilder. > The same update statement (window) works fine, when run from other comput= ers.=C2=A0 Error > occurs only when the statement is run from a particular computer.=C2=A0 T= he SQL Statement is >=20 > Update public.co_voucherseries_transaction_branch > Set=C2=A0 =C2=A0 vouchernumber=C2=A0 =C2=A0=3D > Where=C2=A0 companycode=C2=A0 =C2=A0 =C2=A0=3D '100' > And=C2=A0 =C2=A0 branchcode=C2=A0 =C2=A0 =C2=A0 =3D '001' > And=C2=A0 =C2=A0 accountperiodid =3D 1 > And=C2=A0 =C2=A0 voucherseries=C2=A0 =C2=A0=3D 'SERIES' > And=C2=A0 =C2=A0 voucherversion=C2=A0 =3D 'version' > And=C2=A0 =C2=A0 activestatus=C2=A0 =C2=A0 =3D 'Y'=C2=A0 ; >=20 > The error is > SQLSTATE=3D25P02 > ERROR: current transaction is aborted, commands ignored until end of tran= saction block; > Error while executing the query >=20 > Through googling, I found that last transaction was not properly rolled b= ack. > The (Postgresql) Linux server will be shut down every night and re-booted= next day morning.=C2=A0 =C2=A0 >=20 > Don't know when this error has occurred.=C2=A0=C2=A0 >=20 > Now I need to rectify this error?=C2=A0 How to do it?=C2=A0 Any help is r= eally appreciated. You would have to improve the code quality of the application, which does n= ot seem to do correct error handling or transaction management. That error means that the *previous* statement (or one of the statements ea= rlier in the same database transaction) has caused an error. In PostgreSQL, that me= ans that the transaction is aborted, and the following statements until the end of t= he transaction will receive the error you experience. So one of the following must be the case: - the previous statement caused an error, but you didn't detect or handle t= hat - the previous transaction run on the same database connection caused an er= ror, but you forgot to run ROLLBACK Yours, Laurenz Albe