Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fxeB1-0006iL-Jc for pgsql-general@arkaria.postgresql.org; Wed, 05 Sep 2018 20:13:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fxeAz-0001yG-9Y for pgsql-general@arkaria.postgresql.org; Wed, 05 Sep 2018 20:13:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fxZQb-0006IP-TZ for pgsql-general@lists.postgresql.org; Wed, 05 Sep 2018 15:09:09 +0000 Received: from [195.224.43.67] (helo=mail.manifest.co.uk) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fxZQZ-00072Y-A9 for pgsql-general@lists.postgresql.org; Wed, 05 Sep 2018 15:09:09 +0000 Received: from tim-573P.m1.manifest.co.uk (192.168.1.20) by MAN4.free1.local (192.168.1.4) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 5 Sep 2018 16:09:05 +0100 Subject: Re: PostgreSQL intenal scheduler? To: References: <20180905150607.Horde.or4xIMZA8_s0hktE6pzQyHu@webmail.gelassene-pferde.biz> From: Tim Clarke X-Opacus-Archived: none Organization: Minerva Analytics Ltd Message-ID: <4c73d49a-df5a-3369-b8ec-cb8448fb62db@minerva-analytics.info> Date: Wed, 5 Sep 2018 16:09:04 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180905150607.Horde.or4xIMZA8_s0hktE6pzQyHu@webmail.gelassene-pferde.biz> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Language: en-GB X-Host-Lookup-Failed: Reverse DNS lookup failed for 195.224.43.67 (failed) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 05/09/18 16:06, Thiemo Kellner wrote: > > Hi all > > I am designing a framework for historisation implementation (SCD). One > feature I would like to provide is a table in that the actual state of > an entity is put and if this is complete, this history table is > "updated": > >       ------------         ------------- > ==>  | ENTITY_ACT |  ==>  | ENTITY_HIST | >       ------------         ------------- > > I plan to use instead-of-triggers on the hist table that read the > actual table and perfoms all necessary inserts und updates on the > history table. If I want the termination of a record version (actually > the record of a specific business key with a specific payload) to get > propagated up and/or down referential integrities (no overlapping > validities) I have to make sure that only one of those processes is > modifying a table. I was thinking of a scheduler queue where the > trigger would put a process request and PostgreSQL would work through. > Is there a scheduler within PostgreSQL? I read the documentation and > searched the web but could not find a hint. But before going another > road or implementing something myself, I ask. Maybe this design is no > good at all. > > Kind regards > > Thiemo > > Why not just call your "do a scheduled run" code from cron? Tim Clarke