Re: Determine potential change in table size after a column dropped?

From: Jiankang Ji <myfloopi000(at)gmail(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: Wells Oliver <wells(dot)oliver(at)gmail(dot)com>, Ron <ronljohnsonjr(at)gmail(dot)com>, pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Determine potential change in table size after a column dropped?
Date: 2022-02-01 13:46:07
Message-ID: CAFnD8DUrgpzrUZG9pBqSKgsjoErJ=mS=+JZhuVghsP0hrpo1cg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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

On Mon, 24 Jan 2022 at 17:31, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> wrote:

> On Mon, 2022-01-24 at 08:08 -0800, Wells Oliver wrote:
> > > > I need only drop the column and VACUUM FULL the table, and not the
> entire DB, right?
> > >
> > > Not that VACUUM (FULL) will *not* physically get rid of a dropped
> column,
> > > as it just copies the complete rows to a new table.
> > >
> > > You would need something like:
> > >
> > > CREATE TABLE newtab (LIKE oldtab);
> > > INSERT INTO newtab SELECT * FROM oldtab;
> >
> > So, there's really no way to reclaim space from a dropped column other
> than
> > entirely creating a new table?
>
> Correct, as far as I know.
>
> Yours,
> Laurenz Albe
> --
> Cybertec | https://www.cybertec-postgresql.com
>
>
>
>

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Holger Jakobs 2022-02-01 13:49:33 Re: Determine potential change in table size after a column dropped?
Previous Message Victor Sudakov 2022-01-28 04:14:42 pgbouncer logs and its efficiency