From: Holger Jakobs <holger@jakobs.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: Determine potential change in table size after a column dropped?
Date: Wed, 2 Feb 2022 08:16:00 +0100
Message-ID: <c38b0ee1-527a-5e1c-b807-eb99b26faa2e@jakobs.com> (raw)
In-Reply-To: <CAFnD8DUrgpzrUZG9pBqSKgsjoErJ=mS=+JZhuVghsP0hrpo1cg@mail.gmail.com>
References: <CAOC+FBWMDP4DOPEYMZH6ZS6EzKV8_twSSebGwD2eLUcEK+i4yg@mail.gmail.com>
<CAM+6J96mtviadpmVVN+GuVkrOYM7UQ=A+p6Frs7xz9pGusYkyA@mail.gmail.com>
<c9297bfb-409b-d1b9-9aba-e3c3491068e5@gmail.com>
<CAOC+FBVWoYZS9u1yvAXRa=3fH8gA1m99L+ujAgt4fLf_-kq4ag@mail.gmail.com>
<84b61f419a0a5ba1049c7d74a85b6790bfe9e1e9.camel@cybertec.at>
<CAOC+FBWhRvt9TORHxG1K1AA_MCE+0Y=j7wUzuD6wQShEzDCbdA@mail.gmail.com>
<599f850b109d98148ee512890ebe6ec4bfbfe26b.camel@cybertec.at>
<CAFnD8DUrgpzrUZG9pBqSKgsjoErJ=mS=+JZhuVghsP0hrpo1cg@mail.gmail.com>
Am 01.02.22 um 14:46 schrieb Jiankang Ji:
> Hi All Supermen Experts,
>
> I'm new in pgsql and have a similar problem for a timescale pgDB. A DB
> table is for storing raw sessions data received through IoT network
> from many remote machines. The data format is the same for all the
> machines but the sessions lasting-periods could be different from 1
> minute to 1 hour and such. Each machine could be activated once a day
> or a few times a day randomly.
>
> My question is:
> 1. How to setup a watch-dog to detect new data has been added into the
> DB, and
> 2. How to pick-up the newly completed sessions data since last pick-up
> and put it into a buffer table dedicated to new data for further ETL
> processing?
>
> If you have some scripts in pgSQL, Python or C, it will be greatly
> appreciated!
>
> Thank you.
>
> Best regards, Ji
>
>
>
In order to get notified should new rows arrive (or current ones updated
or deleted), you can install a trigger which fires a NOTIFY command on a
name (channel).
All other sessions which have issued a LISTEN on the same name (channel)
will receive a notification.
Unfortunately, not all languages and drivers support this.
Recently, I updated the code for pg_listen in the script language Tcl.
It's committed, but no new version released yet.
--
Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012
Attachments:
OpenPGP_signature (application/pgp-signature, 202B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: holger@jakobs.com, pgsql-admin@lists.postgresql.org
Subject: Re: Determine potential change in table size after a column dropped?
In-Reply-To: <c38b0ee1-527a-5e1c-b807-eb99b26faa2e@jakobs.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox