Re: When the Session ends in PGSQL?

From: Durumdara <durumdara(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: When the Session ends in PGSQL?
Date: 2011-07-06 13:28:41
Message-ID: CAEcMXhmy8MgUjehA8S5eSG2tH-jkqQhx6yWH2zEDWzwauSy9oA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi!

2011/7/6 Durumdara <durumdara(at)gmail(dot)com>:
>> Most importantly, PostgreSQL's "stored procedures" cannot control
>> transactions. They cannot commit, rollback, or begin a new transaction. They
>> have some control over subtransactions using PL/PgSQL exceptions, but that's
>> about it.
>
> So: I tried it, I created a LOOP/END LOOP infinite procedure, and
> after started with pgAdmin, I killed the pgAdmin.
>
> 8 minutes passed, but server process don't stop this procedure yet.
> Have the process some "limit" on running? When the server kill this process?
> Never because of "working state"?
>
> How to abort it without abort another sessions, or kill the server?

Interesting:

CREATE OR REPLACE FUNCTION a()
RETURNS integer AS
$BODY$BEGIN
LOOP
-- x
END LOOP;
return 1;
END;$BODY$
LANGUAGE plpgsql VOLATILE
COST 100;

select a();

Then the server cannot abort my "query".
Only statement limitation (timeout) helps in this situation.

But I'm not sure what's this timeout meaning?
What is the "statement" what measured?

The main statement (which is visible as last Query in monitor)?
Or substatements also measured one by one, no matter the main length?

For example I have a complex stored procedure that call subqueries, to
provide some records to main query.
The timeout is affected on Total length of main Query, or resetted on
each subselects (statements) I do in my STP?

Thanks:
dd

In response to

Browse pgsql-general by date

  From Date Subject
Next Message devrim 2011-07-06 13:30:29 Re: Performance Monitoring of PostGRE
Previous Message Devrim GÜNDÜZ 2011-07-06 13:23:50 Re: Performance Monitoring of PostGRE