Re: When the Session ends in PGSQL?

Поиск
Список
Период
Сортировка
От Durumdara
Тема Re: When the Session ends in PGSQL?
Дата
Msg-id CAEcMXhmy8MgUjehA8S5eSG2tH-jkqQhx6yWH2zEDWzwauSy9oA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: When the Session ends in PGSQL?  (Durumdara <durumdara@gmail.com>)
Список pgsql-general
Hi!

2011/7/6 Durumdara <durumdara@gmail.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

В списке pgsql-general по дате отправления:

Предыдущее
От: Devrim GÜNDÜZ
Дата:
Сообщение: Re: Performance Monitoring of PostGRE
Следующее
От: devrim@gunduz.org
Дата:
Сообщение: Re: Performance Monitoring of PostGRE