Skip site navigation (1) Skip section navigation (2)

Re: Job control in sql

From: Jan Lentfer <Jan(dot)Lentfer(at)web(dot)de>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Job control in sql
Date: 2012-05-25 12:52:43
Message-ID: 879f6ef6940b25a63a82d87dc0c530c3@neslonek.homeunix.org (view raw or flat)
Thread:
Lists: pgsql-sql
On Fri, 25 May 2012 10:28:03 +0200, Svenne Krap wrote:
[...]
>  The problem is that a later run of run_jobs() will not see the
> job_begun has been set by a prior run (that is unfinished - as all
> queries from the plpgsql-function runs in a single, huge 
> transaction).
>
>
>  My intitial idea was to set the isolation level to "read 
> uncommitted"
> while doing the is-somebody-else-running-lookup, but I cannot change
> that in the plpgsql function (it complains that the session has to be
> empty - even when I have run nothing before it).
>
>  Any ideas on how to solve the issue?

Add a sort of status table where you insert your unique job identifer 
at the start of the function and remove it in the end? As seperate 
transactions of course.

Jan


-- 
professional: http://www.oscar-consult.de
private: http://neslonek.homeunix.org/drupal/

In response to

Responses

pgsql-sql by date

Next:From: danycxxxDate: 2012-05-25 12:57:34
Subject: Re: Select row cells as new columns
Previous:From: Jan LentferDate: 2012-05-25 12:41:33
Subject: Re: Select row cells as new columns

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group