Re: When the Session ends in PGSQL?

From: Vincent de Phily <vincent(dot)dephily(at)mobile-devices(dot)fr>
To: Durumdara <durumdara(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: When the Session ends in PGSQL?
Date: 2011-07-04 11:12:51
Message-ID: 1881735.x2coMu4tie@moltowork
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Monday 04 July 2011 12:49:24 Durumdara wrote:
> What happens with running statements and stored procs at Session's end?
>
> They will be aborted and destroyed, or they can continue the running?
>
> For example:
> User X starts a long Query/STP.
> But he is lost "in deep space" (like in "Space Oddity":
> http://www.youtube.com/watch?v=rKE3FSPJu-4&feature=related)
> The TCP connection aborted, then the Session is set to dead.
> But I don't know what happens with this Query? Is it aborted by Server
> or Running may infinitively?

The running query will be rolled back when the session ends. Note that "when
the session ends" must be understood from the server's point of view, not the
client's.

Temporary tables, prepared statements, and cursors (not an exhaustive list)
will be destroyed too.

Stored procedures will remain. Note that "stored procedures" in postgres are a
bit different from what you may be used to in other dbs; while I assure you
it's for the better, you might want to RTFM to avoid surprises.
--
Vincent de Phily
Mobile Devices
+33 (0) 142 119 325
+353 (0) 85 710 6320

Warning
This message (and any associated files) is intended only for the use of its
intended recipient and may contain information that is confidential, subject
to copyright or constitutes a trade secret. If you are not the intended
recipient you are hereby notified that any dissemination, copying or
distribution of this message, or files associated with this message, is
strictly prohibited. If you have received this message in error, please
notify us immediately by replying to the message and deleting it from your
computer. Any views or opinions presented are solely those of the author
vincent(dot)dephily(at)mobile-devices(dot)fr and do not necessarily represent those of
the
company. Although the company has taken reasonable precautions to ensure no
viruses are present in this email, the company cannot accept responsibility
for any loss or damage arising from the use of this email or attachments.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Durumdara 2011-07-04 11:50:46 Re: When the Session ends in PGSQL?
Previous Message Durumdara 2011-07-04 10:49:24 Re: When the Session ends in PGSQL?