Re: in failed sql transaction - Mailing list pgsql-general

From Alban Hertroys
Subject Re: in failed sql transaction
Date
Msg-id 4517C0E0.6080406@magproductions.nl
Whole thread Raw
In response to Re: in failed sql transaction  ("Gurjeet Singh" <singh.gurjeet@gmail.com>)
Responses Re: in failed sql transaction  ("Gurjeet Singh" <singh.gurjeet@gmail.com>)
List pgsql-general
Gurjeet Singh wrote:
>      > All other databases I used up to now just ignore the statement
>     violating the
>      > constraint, but leave the transaction intact.
>
>     Which databases behave that way?  Does COMMIT succeed even if some
>     statements failed?
>
>
> Oracle, for one, behaves that way... Yes, COMMIT does succeed even if
> some statement(s) threw errors.

Actually, Oracle implicitly COMMIT's all open transactions if someone
performs a DDL statement on the table (or even the same schema?).

What other databases do is not necessarily correct[1]. In this case
PostgreSQL does the right thing; something went wrong, queries after the
error may very well depend on that data - you can't rely on the current
state. And it's what the SQL specs say too, of course...

[1] I'm not trying to imply that what PostgreSQL does is (in general).
--
Alban Hertroys
alban@magproductions.nl

magproductions b.v.

T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
    7500 AK Enschede

// Integrate Your World //

pgsql-general by date:

Previous
From: Karsten Hilbert
Date:
Subject: Re: in failed sql transaction
Next
From: Bo Lorentsen
Date:
Subject: Re: Replication and PITR