Re: [GENERAL] auto-reconnect: temp schemas, sequences, transactions

2011-05-12 Thread Marek Więckowski
Hi, Just to sum things up: On Wednesday 04 May 2011 19:21:42 Tom Lane wrote: > Well, I think it's foolish to imagine that a client library should try > to do transparent reconnection: it's somewhere between difficult and > impossible to keep track of all the server-side state that the > applicati

Re: [GENERAL] auto-reconnect: temp schemas, sequences, transactions

2011-05-04 Thread Andrew Sullivan
On Wed, May 04, 2011 at 07:03:31PM +0200, Marek Więckowski wrote: > (and this is why I was looking into this in the first place). There is a > danger that client programs will continue issuing queries while believing > that > they are in a transaction... They do expect db errors and rolled back

Re: [GENERAL] auto-reconnect: temp schemas, sequences, transactions

2011-05-04 Thread Tom Lane
Marek =?utf-8?q?Wi=C4=99ckowski?= writes: > But for the library which I'm using, simply exiting/aborting is not an option > (and this is why I was looking into this in the first place). There is a > danger that client programs will continue issuing queries while believing > that > they are in

Re: [GENERAL] auto-reconnect: temp schemas, sequences, transactions

2011-05-04 Thread Marek Więckowski
On Wednesday 04 May 2011 18:04:16 Tom Lane wrote: > Marek Wieckowski writes: > > If there is a script executed in psql there is no easy way to catch that > > psql has reconnected in the middle of it... > > As far as psql goes, it should certainly abandon executing any script > file if it loses th

Re: [GENERAL] auto-reconnect: temp schemas, sequences, transactions

2011-05-04 Thread Tom Lane
Marek =?utf-8?q?Wi=C4=99ckowski?= writes: > If there is a script executed in psql there is no easy way to catch that psql > has reconnected in the middle of it... As far as psql goes, it should certainly abandon executing any script file if it loses the connection. I rather thought it did alrea

Re: [GENERAL] auto-reconnect: temp schemas, sequences, transactions

2011-05-04 Thread Marek Więckowski
On Monday 02 May 2011 17:32:26 Tom Lane wrote: > If the client-side logic tries to re-issue these queries > after re-connecting, it would be up to that logic to be careful about > what to reissue or not. Possibly this is a question for the author > of your client library. I see. So I have two use

Re: [GENERAL] auto-reconnect: temp schemas, sequences, transactions

2011-05-02 Thread Tom Lane
Marek =?utf-8?q?Wi=C4=99ckowski?= writes: > But what happens with a db transaction upon disconnect? If I have (say, in > c++ > code or a script): > begin; > query1; > query2; > query3; > query4; > query5; > commit; > (with possibly some extra c++ or script code in between queries), and > some

Re: [GENERAL] auto-reconnect: temp schemas, sequences, transactions

2011-05-02 Thread Marek Więckowski
Hi, On Monday 02 May 2011 16:43:54 Tom Lane wrote: > Marek Wieckowski writes: > > 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 a

Re: [GENERAL] auto-reconnect: temp schemas, sequences, transactions

2011-05-02 Thread Tom Lane
Marek =?utf-8?q?Wi=C4=99ckowski?= writes: > 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

[GENERAL] auto-reconnect: temp schemas, sequences, transactions

2011-05-02 Thread Marek Więckowski
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