Re: [HACKERS] Switching between terminals

From: Csaba Nagy <nagy(at)ecircle-ag(dot)com>
To: cheriyamoozhiyilcinu(at)yahoo(dot)co(dot)in
Cc: pgsql-hackers(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Subject: Re: [HACKERS] Switching between terminals
Date: 2008-07-03 14:59:17
Message-ID: 1215097157.2834.133.camel@PCD12478
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Thu, 2008-07-03 at 19:56 +0530, cinu wrote:
> Could anyone please tell me where I am going wrong and if there is a
> way I can get the same behaviour that I am getting while I am
> executing the through psql prompt.

You're mistake is that you think a transaction is related to your
terminal, but it is in fact tied to the psql session you are running...

Your first example is running one psql instance per terminal, hence one
transaction per terminal, while in your second example the transaction
is terminated each time psql finishes to run. Basically what you're
asking for is to keep a transaction opened by one session (the first
psql execution) and connect to it with the second session (the second
psql call) and continue the transaction which was opened by the first
one... which I'm pretty sure is wrong to want. It is likely possible to
do (using PREPARE TRANSACTION), but even likelier that it is a wrong
thing to do in normal circumstances. If you'll say what you really want
to do, I bet you'll get a lot more useful advices...

Cheers,
Csaba.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Csaba Nagy 2008-07-03 15:03:37 Re: Switching between terminals
Previous Message cinu 2008-07-03 14:26:56 Switching between terminals

Browse pgsql-hackers by date

  From Date Subject
Next Message Csaba Nagy 2008-07-03 15:03:37 Re: Switching between terminals
Previous Message Bernd Helmle 2008-07-03 14:36:02 Re: Adding variables for segment_size, wal_segment_size and block sizes