DEV Community

RK
RK

Posted on

What are the errors that can occur during the pg_repack ?

  1. pg_repack VER is not installed in the database

2.program 'pg_repack V1' does not match database library 'pg_repack V2' --version mismatch

  1. relation "table" must have a primary key or not-null unique keys

4.the table "tbl" already has a trigger called repack_trigger

  • Due to session timeout or bastion disconnect
  1. Another pg_repack command may be running on the table
  • We couldn't execute the simultaneously pg_repack on multiple tables

Some important points:

  • Only superusers can use the utility.
  • Target table must have a PRIMARY KEY, or at least a UNIQUE total index on a NOT NULL column.
  • Defaults of pg_repack may not be good for critical systems. use --no-kill-backend or -D option to make it more gentle
  • No DDLs are allowed against the table which is undergoing pg_repack and any session that attempts to do so might get killed.
  • pg_repack, by default, will attempt canceling the conflicting statements if it is not able to gain AcessExclusive lock-in wait-time
  • It may proceed to terminate sessions if the total wait exceeds double the amount of wait time. This could lead to undesirable outcomes and outages
  • Use (-N, --dry-run) Before to perform the pg_repack to understand what would have been repacked and exit

https://www.youtube.com/watch?v=Ngx4bNqpMcI

Top comments (1)

Collapse
 
ettaluna profile image
EttaLuna

I'm going to read this. I'll be sure to come back. thanks for sharing. get lost love back by vashikaran