User Tools

Site Tools


postgresqlextensions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
postgresqlextensions [2024/03/01 15:20] z0hpvkpostgresqlextensions [2025/03/08 22:24] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ===== PostgreSQL Extensions ===== ===== PostgreSQL Extensions =====
  
-==== PG_CRON ====+==== pg_cron ====
 [[https://github.com/citusdata/pg_cron/]]\\ [[https://github.com/citusdata/pg_cron/]]\\
  
Line 24: Line 24:
 SELECT cron.schedule_in_database('Vacuum Analyze', '0 6 * * 0', $$VACUUM ANALYZE$$, 'doob'); SELECT cron.schedule_in_database('Vacuum Analyze', '0 6 * * 0', $$VACUUM ANALYZE$$, 'doob');
 SELECT cron.unschedule(<job_id>); SELECT cron.unschedule(<job_id>);
 +
 SELECT jobid, jobname, schedule, database, active FROM cron.job; SELECT jobid, jobname, schedule, database, active FROM cron.job;
 +
 SELECT jobname,  SELECT jobname, 
        status, to_char(start_time,'DD-MM-YYYY HH24:MI') as start_date,         status, to_char(start_time,'DD-MM-YYYY HH24:MI') as start_date, 
Line 34: Line 36:
 </code> </code>
  
-==== PGLOGICAL ====+==== pglogical ====
 [[https://www.2ndquadrant.com/en/resources/pglogical/]] [[https://www.2ndquadrant.com/en/resources/pglogical/]]
  
Line 42: Line 44:
 </code> </code>
  
-==== PGBOUNCER ====+==== pgbouncer ====
 [[https://www.pgbouncer.org/config.html]]\\ [[https://www.pgbouncer.org/config.html]]\\
 <code> <code>
Line 57: Line 59:
 RELOAD; RELOAD;
 </code> </code>
-==== PG_STAT_STATEMENTS ====+==== pg_stat_statements ====
 [[https://www.postgresql.org/docs/current/pgstatstatements.html]] [[https://www.postgresql.org/docs/current/pgstatstatements.html]]
  
Line 69: Line 71:
 </code> </code>
  
-==== POSTGIS ====+==== postgis ====
 [[https://postgis.net/]] [[https://postgis.net/]]
 <code> <code>
Line 78: Line 80:
 </code> </code>
  
-==== POSTGRES_FDW ====+==== postgres_fdw ====
 [[https://www.postgresql.org/docs/current/postgres-fdw.html]] [[https://www.postgresql.org/docs/current/postgres-fdw.html]]
  
-==== PG_BUFFERCACHE ====+==== pg_buffercache ====
 [[https://www.postgresql.org/docs/current/pgbuffercache.html]] [[https://www.postgresql.org/docs/current/pgbuffercache.html]]
 <code> <code>
Line 104: Line 106:
 </code> </code>
  
-==== PGBADGER ====+==== pgbadger ====
 [[https://pgbadger.darold.net/]]\\ [[https://pgbadger.darold.net/]]\\
  
Line 134: Line 136:
 </code> </code>
 [[PGBadgerReports| PGBadger Reports]]\\ [[PGBadgerReports| PGBadger Reports]]\\
 +
 +==== pg_repack ====
 +=== AWS Instructions ===
 +https://aws.amazon.com/blogs/database/remove-bloat-from-amazon-aurora-and-rds-for-postgresql-with-pg_repack/
 +=== Download ===
 +For PostgreSQL 14 on AWS, use version 1.4.7. \\
 +https://pgxn.org/dist/pg_repack/1.4.7/
 +=== Installation ===
 +https://reorg.github.io/pg_repack/#installation
 +<code bash>
 +sudo apt install postgresql-server-dev-12 gcc zlib1g-dev
 +
 +unzip pg_repack-1.4.5.zip
 +cd pg_repack-1.4.5
 +make
 +sudo make install
 +</code>
 +<code postgresql>
 +CREATE EXTENSION pg_repack;
 +</code>
 +
 +=== Usage ===
 +pg_repack will attempt to get an exclusive lock on the table being re-organised. \\
 +If it can’t then, by default, it will attempt to terminate any sessions that are blocking it. \\
 +
 +Use option ''--no-kill-backend (-D)'' to allow pg_repack to terminate if it can’t get a lock. \\
 +
 +<code bash>
 +cd pg_repack-1.4.5/bin
 +./pg_repack -k -h localhost -U postgres -D -t football.teams doob
 +</code>
postgresqlextensions.1709306452.txt.gz · Last modified: 2025/03/08 22:23 (external edit)