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 1sK2uh-0082xH-GA for pgsql-general@arkaria.postgresql.org; Wed, 19 Jun 2024 21:32:19 +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 1sK2uc-007iGW-Ut for pgsql-general@arkaria.postgresql.org; Wed, 19 Jun 2024 21:32:15 +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 1sK2uc-007iFZ-Jd for pgsql-general@lists.postgresql.org; Wed, 19 Jun 2024 21:32:15 +0000 Received: from mail.appl-ecosys.com ([50.126.108.78]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sK2uW-0028re-LR for pgsql-general@postgresql.org; Wed, 19 Jun 2024 21:32:14 +0000 Received: from salmo.appl-ecosys.com (salmo.appl-ecosys.com [192.168.55.1]) by mail.appl-ecosys.com (Postfix) with ESMTP id 39A3B2A2B7C for ; Wed, 19 Jun 2024 14:32:07 -0700 (PDT) Date: Wed, 19 Jun 2024 14:32:07 -0700 (PDT) From: Rich Shepard To: pgsql-general@postgresql.org Subject: Re: Transaction issue In-Reply-To: <039e657e-5dbc-4243-8c82-865ccb2c2fe5@aklaver.com> Message-ID: References: <65F95FD4-CBEA-4E66-AE63-EBC9F617C988@gmail.com> <7678da90-521-3b52-4bb5-11bc9bdf6d1@appl-ecosys.com> <039e657e-5dbc-4243-8c82-865ccb2c2fe5@aklaver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 19 Jun 2024, Adrian Klaver wrote: > 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) Yes, I see how this works if the transaction is committed. But before I commit the transaction I run a select statement to ensure the rows added are correct. Can I rollback a commited transaction? I've assumed not, so I won't commit the transaction without testing. And I'm not getting a detailed error message. Rich