Re: Postgresql prepared transactions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Radosław Smogura <rsmogura(at)softperience(dot)eu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Postgresql prepared transactions
Date: 2011-02-18 23:48:00
Message-ID: 28419.1298072880@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

=?utf-8?q?Rados=C5=82aw_Smogura?= <rsmogura(at)softperience(dot)eu> writes:
> I do following commands

> test=# BEGIN;
> BEGIN
> test=# insert into testxa1 values(1);
> INSERT 0 1
> test=# insert ddddduuuuuppppp;
> ERROR: syntax error at or near "ddddduuuuuppppp"
> LINE 1: insert ddddduuuuuppppp;
> ^
> test=# PREPARE TRANSACTION 'a';
> ROLLBACK

> Why on prepare transaction I got rollback.

Because the transaction had already failed due to the error. This is
the same as if you'd done a plain COMMIT at that point.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rich Shepard 2011-02-18 23:48:26 Re: Explicit NULL for no INTEGER data? -- Update
Previous Message Radosław Smogura 2011-02-18 23:29:59 Postgresql prepared transactions