Re: Transaction issue

From: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Transaction issue
Date: 2024-06-19 21:32:07
Message-ID: f2e68f61-5bed-36a-65aa-59995dfb3d7@appl-ecosys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rich Shepard 2024-06-19 21:33:17 Re: Transaction issue
Previous Message Adrian Klaver 2024-06-19 21:09:56 Re: Transaction issue