Re: Transaction issue - Mailing list pgsql-general

From Rich Shepard
Subject Re: Transaction issue
Date
Msg-id f2e68f61-5bed-36a-65aa-59995dfb3d7@appl-ecosys.com
Whole thread Raw
In response to Re: Transaction issue  (Adrian Klaver <adrian.klaver@aklaver.com>)
Responses Re: Transaction issue
List pgsql-general
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




pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Transaction issue
Next
From: Rich Shepard
Date:
Subject: Re: Transaction issue