Thread: Session disconnected
Hi,
I got a question on how postgres handle an interrupted transaction, regarding rollback, commit.
We do have a rather unstable connection to our db and sometime a transaction/session will be disconnected but the process is still visible on the server.
How will postgres handle an update transaction from a client to the server that is disconnected?
- will the query be rollbacked automatically ??
- is it safe to just kill the hanging process on the server?
Regards
Jan Lindgren, Stabilizer
On Thu, 2003-03-13 at 05:28, Jan.Lindgren wrote: > Hi, > I got a question on how postgres handle an interrupted transaction, > regarding rollback, commit. > > We do have a rather unstable connection to our db and sometime a > transaction/session will be disconnected but the process is still > visible on the server. > > How will postgres handle an update transaction from a client to the > server that is disconnected? > - will the query be rollbacked automatically ?? > - is it safe to just kill the hanging process on the server? > More or less yes. Without getting too far into the pg internals, understand that any information written in the database is not marked as valid until it is given a commit. Eventually vacuum will notice that the transaction tied to the entry is no longer valid, and will remove the dead weight. Robert Treat