Re: What is the best setup for distributed and fault-tolerant PG database?

2023-01-04 Thread Bryn Llewellyn
>>> age.apa...@gmail.com wrote: >>> >>> I am new to postgres, and I am also not a DBA. I am a solo developer who is >>> trying to evaluate what database to use for my hybrid multi-tenancy >>> sub-apps i.e. users of the application will be authorised to use part or >>> whole of the application b

Re: What is the best setup for distributed and fault-tolerant PG database?

2023-01-04 Thread Saul Perdomo
What Rob said... plus, I would urge you to give some more thought to "for audit purposes the data is append only". If your application is ever successful, non-insignificant storage costs are something you'll need to deal with sooner or later. Anyway, what you ask is certainly achievable, but not w

Re: What is the best setup for distributed and fault-tolerant PG database?

2023-01-04 Thread Rob Sargent
On 1/4/23 06:26, Age Apache wrote: Dear PG experts, I am new to postgres, and I am also not a DBA. I am a solo developer who is trying to evaluate what database to use for my hybrid multi-tenancy sub-apps i.e. users of the application will be authorised to use part or whole of the application

Re: curious postgres (crash) recovery behavior

2023-01-04 Thread Rébeli-Szabó Tamás
I think your log shows a continued archive recovery (PITR), not a crash recovery. For a crash recovery (automatic recovery), you would see something like this in the server log: LOG:  database system was interrupted; last known up at 2022-12-23 20:50:13 CET LOG:  database system was not pro

Corrupt WAL in replication slot

2023-01-04 Thread Fontana Daniel (Desartec S.R.L.)
In a replication scheme, one of the satellite databases that replicates against a consolidated database has one of the WAL files corrupted, more precisely the 0001009 file. I try the pg_replication_slot_advance() function to move pg_lsn to skip the error, but it tells me there

Re: REINDEX vs VACUUM

2023-01-04 Thread Rébeli-Szabó Tamás
I have looked more into it and have found that VACUUM FULL (and CLUSTER) does in fact rebuild indexes, see for example: https://github.com/postgres/postgres/blob/c8e1ba736b2b9e8c98d37a5b77c4ed31baf94147/src/backend/commands/cluster.c#L1463 I have also run some tests and have come to understand

curious postgres (crash) recovery behavior

2023-01-04 Thread Zwettler Markus (OIZ)
We are using Crunchy PGO which uses "pgbackrest". Over Christmas we had a disk full error on the "pgbackrest" repo followed by a disk full error on the PostgreSQL instance pod. Unfortunately, a colleague then deleted the current "pg_wal" directory on the instance pod. So we had to do a point-in-t

Re: REINDEX vs VACUUM

2023-01-04 Thread Ron
I don't think VACUUM FULL (copy the table, create new indices and other metadata all in one command) actually vacuums tables.  It's a misleading name. Something like REBUILD TABLE would be a better name. On 1/4/23 07:25, Rébeli-Szabó Tamás wrote: Here is my understanding: REINDEX recreates th

What is the best setup for distributed and fault-tolerant PG database?

2023-01-04 Thread Age Apache
Dear PG experts, I am new to postgres, and I am also not a DBA. I am a solo developer who is trying to evaluate what database to use for my hybrid multi-tenancy sub-apps i.e. users of the application will be authorised to use part or whole of the application based on their authorisation levels. Th

Re: REINDEX vs VACUUM

2023-01-04 Thread Rébeli-Szabó Tamás
Here is my understanding: REINDEX recreates the index from scratch, using the data stored in the underlying table. It is the same as dropping and recreating the index manually, with regard to the impact on the index file. It can free up physical space in the file system. REINDEX will not vacuu

Re: REINDEX vs VACUUM

2023-01-04 Thread Hao Zhang
+ pgsql-admin Would appreciate any insights. Thanks On Sat, Dec 31, 2022 at 1:04 PM Hao Zhang wrote: > What is the difference between reindex and vacuum's impact on index file? > I deleted an indexed row. Running either vacuum or reindex shows the index > entry for the row is removed from the in