Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hned8-00038C-HP for pgsql-general@arkaria.postgresql.org; Wed, 17 Jul 2019 07:45:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hned7-0007qS-7X for pgsql-general@arkaria.postgresql.org; Wed, 17 Jul 2019 07:45:37 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1hned6-0007pP-Qf for pgsql-general@lists.postgresql.org; Wed, 17 Jul 2019 07:45:36 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hnecc-0006bB-Oa for pgsql-general@lists.postgresql.org; Wed, 17 Jul 2019 07:45:36 +0000 Received: by mail-pl1-x62c.google.com with SMTP id y8so11498004plr.12 for ; Wed, 17 Jul 2019 00:45:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=FtFIh2Qvg17YgkKZi3ixqSfUs2yFSKuIqZg85Tblgzc=; b=fykogAWhoJl0CFnzHX1WjM/5e1s6IjFrbgza250q0/32IpI0xZtyzcGLkHsSak9xjP 9CGD8FTHlmew0YQcdLjX+DKg8XHiY8ph7UTdgvkIC143kCDMm1gw0rcplTn7qFfTwY6Y aKMTA04+7nZow855ZB7zj38+PQp8T+FUqXnPkPmXw5SgT9XAszinVRRVEWb28xwymDM0 c8AVIXR1jfo8bz/bKtrBYBv23XrBPAlXEZcNF1mHQwg3CDhmDaeUA6tYOKfMU9L3K2Ff E5EuXFI1gLZ0QXerv9IPnsrEIjKEaw19LzI0e4fv1vTLMI6m26qbX5PFxN0kr2rKmajv SX5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=FtFIh2Qvg17YgkKZi3ixqSfUs2yFSKuIqZg85Tblgzc=; b=MTJz+YHd275Bd20HAMYzb0+ZjIQE6VskBu9sUx8rptc5qkdFKJYIMZiZkA75p5/VuH irf3iszB1eWMtw+8IQW/nmzkpAytmc/hPX5CBVSbfT4Y2of9z2GcT5gVZNQOcV1Duj/J 4AUqca48twWOcWJ5DI1Pib/IIS/BDqeZO54akFOneBQpkjjwQZHqvDD5sYFuI/88/pPt 9Mw6qMn69pz33XpHAin84b1Bx+MylMJagKbl7ZOS/AuUAVdu+FqLsujeUnNk/2mPwkbp acD5WNrrZvIgE3U4DjKGIuggvj6T5MVEXvM48ftcQOF4RMSsdBTmwIKf4MhQ4EPRBP4S av/g== X-Gm-Message-State: APjAAAUS3CXbu5Yd6N03H7mzVJB/8MB9cFXYIx0qgbetEKSq4JNVENGV hHzyPZKiDatju0IvcX87M8Q= X-Google-Smtp-Source: APXvYqx41kqdAK+R0mhNrwgQTP0EooA0CK7qIv9MzmUIzoL79GU9+3bxXyRumx3J7JfbAEK7GaWBMg== X-Received: by 2002:a17:902:4201:: with SMTP id g1mr41571061pld.300.1563349504270; Wed, 17 Jul 2019 00:45:04 -0700 (PDT) Received: from [10.0.0.56] (c-73-63-59-118.hsd1.ut.comcast.net. [73.63.59.118]) by smtp.gmail.com with ESMTPSA id 14sm35281517pfj.36.2019.07.17.00.45.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Jul 2019 00:45:03 -0700 (PDT) From: Rob Sargent Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_D266875C-E376-428A-B42F-64EC6601ED8E" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: How to run a task continuously in the background Date: Wed, 17 Jul 2019 01:45:02 -0600 In-Reply-To: Cc: "Weatherby,Gerard" , "pgsql-general@lists.postgresql.org" To: Dirk Mika References: <7932668C-EA48-436B-AA15-DB7C8446D57F@mikatiming.de> <14555705-8010-4A73-8501-EA07B285E1BA@mikatiming.de> <1563278313157.67005@uchc.edu> X-Mailer: Apple Mail (2.3445.104.11) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail=_D266875C-E376-428A-B42F-64EC6601ED8E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Jul 17, 2019, at 1:26 AM, Dirk Mika = wrote: >=20 > =20 > We used a trigger that called pg_notify = (https://www.postgresql.org/docs/9.5/sql-notify.html = =E2=80=8B) and then = had another >=20 > process that LISTENed for notifications. >=20 > =20 >=20 > What kind of process is this? I'm assuming that this is an application = written in C. >=20 > =20 >=20 > The advantage of LISTEN / NOTIFY is only that the process which should = process data does not have to do polling, but is notified when there is = something to do. >=20 > =20 >=20 > Dirk >=20 Also, the NOTIFY wouldn=E2=80=99t significantly extend the lifetime or = impact of the trigger. > =20 >=20 > --=20 > Dirk Mika > Software Developer >=20 > >=20 > mika:timing GmbH > Strundepark - K=C3=BCrtener Str. 11b > 51465 Bergisch Gladbach > Germany >=20 >=20 > fon +49 2202 2401-1197=20 > dirk.mika@mikatiming.de > www.mikatiming.de >=20 >=20 > AG K=C3=B6ln HRB 47509 * WEEE-Reg.-Nr. DE 90029884=20 > Gesch=C3=A4ftsf=C3=BChrer: Harald Mika, J=C3=B6rg Mika >=20 > = --Apple-Mail=_D266875C-E376-428A-B42F-64EC6601ED8E Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On Jul 17, 2019, at 1:26 AM, Dirk Mika <Dirk.Mika@mikatiming.de> wrote:

 

We used a trigger that called pg_notify (https://www.postgresql.org/docs/9.5/sql-notify.html=E2=80=8B= ) and then had another

process that LISTENed for notifications.

 

What kind of = process is this? I'm assuming that this is an application written in = C.

 

The advantage of = LISTEN / NOTIFY is only that the process which should process data does = not have to do polling, but is notified when there is something to = do.

 

Dirk

Also, the NOTIFY = wouldn=E2=80=99t significantly extend the lifetime or impact of the = trigger.

 

-- 
Dirk Mika
Software Developer

<image001_= d0a5cf51-5dd3-4ff5-b428-1016a6d95a0f.png>

mika:timing GmbH
Strundepark - K=C3=BCrtener Str. 11b
51465 Bergisch = Gladbach
Germany

fon +49 2202 = 2401-1197 
dirk.mika@mikatiming.de
www.mikatiming.de

AG K=C3=B6ln= HRB 47509 * WEEE-Reg.-Nr. DE 90029884 
Gesch=C3=A4ftsf=C3=BChrer: Harald Mika, J=C3=B6rg = Mika


= --Apple-Mail=_D266875C-E376-428A-B42F-64EC6601ED8E--

<CCh2U_f27a5c= e6-8556-4db1-8aa4-fd610d6e9efe.jpg>