Re: [HACKERS] tab completion for prepared transactions?

2010-01-25 Thread Peter Eisentraut
On sön, 2010-01-24 at 21:56 +0200, Heikki Linnakangas wrote: PREPARE TRANSACTION is not intended for use in applications or in interactive sessions. It's purpose is to allow an external transaction manager to perform atomic global transactions across multiple databases or other

Re: [HACKERS] tab completion for prepared transactions?

2010-01-24 Thread Heikki Linnakangas
Peter Eisentraut wrote: On lör, 2010-01-23 at 12:42 -0500, Tom Lane wrote: Peter Eisentraut pete...@gmx.net writes: Was there a designed-in reason not to have psql tab completion for COMMIT/ROLLBACK PREPARED ...? It does complete the PREPARED but not the transaction identifiers. Maybe it's

Re: [HACKERS] tab completion for prepared transactions?

2010-01-24 Thread Bruce Momjian
Heikki Linnakangas wrote: Peter Eisentraut wrote: On l?r, 2010-01-23 at 12:42 -0500, Tom Lane wrote: Peter Eisentraut pete...@gmx.net writes: Was there a designed-in reason not to have psql tab completion for COMMIT/ROLLBACK PREPARED ...? It does complete the PREPARED but not the

Re: [HACKERS] tab completion for prepared transactions?

2010-01-24 Thread Heikki Linnakangas
Bruce Momjian wrote: Heikki Linnakangas wrote: Right, I vaguely recall that the idea of tab-completion for those commands was rejected when 2PC was added because of that. A user sitting at a psql terminal is not supposed to prepare a transaction. That's application server's business. I

Re: [HACKERS] tab completion for prepared transactions?

2010-01-24 Thread Bruce Momjian
Heikki Linnakangas wrote: Bruce Momjian wrote: Heikki Linnakangas wrote: Right, I vaguely recall that the idea of tab-completion for those commands was rejected when 2PC was added because of that. A user sitting at a psql terminal is not supposed to prepare a transaction. That's

Re: [HACKERS] tab completion for prepared transactions?

2010-01-24 Thread Simon Riggs
On Sun, 2010-01-24 at 19:29 +0200, Heikki Linnakangas wrote: Peter Eisentraut wrote: On lör, 2010-01-23 at 12:42 -0500, Tom Lane wrote: Peter Eisentraut pete...@gmx.net writes: Was there a designed-in reason not to have psql tab completion for COMMIT/ROLLBACK PREPARED ...? It does

Re: [HACKERS] tab completion for prepared transactions?

2010-01-24 Thread Tom Lane
Heikki Linnakangas heikki.linnakan...@enterprisedb.com writes: Peter Eisentraut wrote: The scenario that I encountered is that you go around manually cleaning them up when the XA software fails for some reason. Hmm, that's a good point though. Maybe it would make sense to add tab completion

Re: [HACKERS] tab completion for prepared transactions?

2010-01-24 Thread Tom Lane
Simon Riggs si...@2ndquadrant.com writes: I would like a mechanism in the server to prevent a session from accepting anything other than COMMIT or ROLLBACK PREPARED after a PREPARE. Otherwise it's possible to screw up your prepared xact and leave it hanging there. Uh, what? That makes no

Re: [HACKERS] tab completion for prepared transactions?

2010-01-24 Thread Simon Riggs
On Sun, 2010-01-24 at 12:54 -0500, Tom Lane wrote: Simon Riggs si...@2ndquadrant.com writes: I would like a mechanism in the server to prevent a session from accepting anything other than COMMIT or ROLLBACK PREPARED after a PREPARE. Otherwise it's possible to screw up your prepared xact and

Re: [HACKERS] tab completion for prepared transactions?

2010-01-24 Thread Peter Eisentraut
On sön, 2010-01-24 at 19:43 +0200, Heikki Linnakangas wrote: PREPARE TRANSACTION is not intended for use in applications or in interactive sessions. It's purpose is to allow an external transaction manager to perform atomic global transactions across multiple databases or other transactional

Re: [HACKERS] tab completion for prepared transactions?

2010-01-24 Thread Heikki Linnakangas
Tom Lane wrote: Heikki Linnakangas heikki.linnakan...@enterprisedb.com writes: Hmm, that's a good point though. Maybe it would make sense to add tab completion for ROLLBACK/COMMIT PREPARED, but not for PREPARE TRANSACTION? Huh? PREPARE TRANSACTION creates a new gxid, so there's nothing for

Re: [HACKERS] tab completion for prepared transactions?

2010-01-24 Thread Heikki Linnakangas
Peter Eisentraut wrote: What is the difference between a transaction manager and an application that opens multiple connections and does PREPARE + COMMIT PREPARED across them? It's what happens if your application crashes after issuing the PREPARE. A correctly configured transaction manager

Re: [HACKERS] tab completion for prepared transactions?

2010-01-24 Thread Heikki Linnakangas
Bruce Momjian wrote: Heikki Linnakangas wrote: Bruce Momjian wrote: Heikki Linnakangas wrote: Right, I vaguely recall that the idea of tab-completion for those commands was rejected when 2PC was added because of that. A user sitting at a psql terminal is not supposed to prepare a

[HACKERS] tab completion for prepared transactions?

2010-01-23 Thread Peter Eisentraut
Was there a designed-in reason not to have psql tab completion for COMMIT/ROLLBACK PREPARED ...? It does complete the PREPARED but not the transaction identifiers. Maybe it's not a common use case, but these transaction identifiers sure can be nontrivial to type. -- Sent via pgsql-hackers

Re: [HACKERS] tab completion for prepared transactions?

2010-01-23 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: Was there a designed-in reason not to have psql tab completion for COMMIT/ROLLBACK PREPARED ...? It does complete the PREPARED but not the transaction identifiers. Maybe it's not a common use case, but these transaction identifiers sure can be

Re: [HACKERS] tab completion for prepared transactions?

2010-01-23 Thread Peter Eisentraut
On lör, 2010-01-23 at 12:42 -0500, Tom Lane wrote: Peter Eisentraut pete...@gmx.net writes: Was there a designed-in reason not to have psql tab completion for COMMIT/ROLLBACK PREPARED ...? It does complete the PREPARED but not the transaction identifiers. Maybe it's not a common use case,