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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.albe@xxxxxxxxxxx> 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




[Index of Archives]     [Postgresql Home]     [Postgresql General]     [Postgresql Performance]     [Postgresql PHP]     [Postgresql Jobs]     [PHP Users]     [PHP Databases]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Forum]

  Powered by Linux