auto-reconnect: temp schemas, sequences, transactions - Mailing list pgsql-general

From Marek Więckowski
Subject auto-reconnect: temp schemas, sequences, transactions
Date
Msg-id 201105020935.33628.wieckom@foxi.nl
Whole thread Raw
Responses Re: auto-reconnect: temp schemas, sequences, transactions  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Hi,

If I understand correctly, Tom's reply in:
http://archives.postgresql.org/pgsql-general/2007-06/msg01668.php suggests
that temp schemas are kept when a session gets disconnected because
connections get automatically re-established with the same backend id, and if
this succeeds the old temp tables get picked up by the new connection as if
there was no disconnection at all.

However, it seems that the same does not happen for currval of sequences? This
is quite inconvenient, I must say (in some situations our re-established
connection is basically useless... and it even does not "know" about it...).

For my information: what happens if the disconnect (due to another client
process dying) happened during a transaction? After reconnect are we again in
the middle of the previous transaction? (Or does something else happen, e.g.
the transaction continues until "commit" and only then the session actually
disconnects?) I'm anxiously assuming that it's not like the next queries after
reconnection will happily be executed outside of a transaction, but I haven't
found much (recent) info on the subject.

Best,
~Marek

=# select version();
 version
---------------------------------------------------------------------------------------
 PostgreSQL 8.4.4 on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC)
4.4.4, 64-bit
(1 row

pgsql-general by date:

Previous
From: Mark Morgan Lloyd
Date:
Subject: Re: Postgresql, PSN hack and table limits
Next
From: Andres Freund
Date:
Subject: Re: pervasiveness of surrogate (also called synthetic) keys