postgresqlextensions
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
postgresqlextensions [2024/03/01 15:18] – z0hpvk | postgresqlextensions [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:// | [[https:// | ||
Line 22: | Line 22: | ||
<code SQL> | <code SQL> | ||
SELECT cron.schedule(' | SELECT cron.schedule(' | ||
+ | SELECT cron.schedule_in_database(' | ||
SELECT cron.unschedule(< | SELECT cron.unschedule(< | ||
- | SELECT | + | |
- | SELECT | + | SELECT |
+ | |||
+ | SELECT | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | JOIN cron.job j on j.jobid = jrd.jobid | ||
+ | ORDER BY start_time; | ||
</ | </ | ||
- | ==== PGLOGICAL | + | ==== pglogical |
[[https:// | [[https:// | ||
Line 35: | Line 44: | ||
</ | </ | ||
- | ==== PGBOUNCER | + | ==== pgbouncer |
[[https:// | [[https:// | ||
< | < | ||
Line 50: | Line 59: | ||
RELOAD; | RELOAD; | ||
</ | </ | ||
- | ==== PG_STAT_STATEMENTS | + | ==== pg_stat_statements |
[[https:// | [[https:// | ||
Line 62: | Line 71: | ||
</ | </ | ||
- | ==== POSTGIS | + | ==== postgis |
[[https:// | [[https:// | ||
< | < | ||
Line 71: | Line 80: | ||
</ | </ | ||
- | ==== POSTGRES_FDW | + | ==== postgres_fdw |
[[https:// | [[https:// | ||
- | ==== PG_BUFFERCACHE | + | ==== pg_buffercache |
[[https:// | [[https:// | ||
< | < | ||
Line 97: | Line 106: | ||
</ | </ | ||
- | ==== PGBADGER | + | ==== pgbadger |
[[https:// | [[https:// | ||
Line 103: | Line 112: | ||
<code text> | <code text> | ||
--exclude-line | --exclude-line | ||
- | --include-query | + | --include-query |
--top (t) Number of top SQL queries | --top (t) Number of top SQL queries | ||
--sample-number (s) Number of example queries | --sample-number (s) Number of example queries | ||
Line 127: | Line 136: | ||
</ | </ | ||
[[PGBadgerReports| PGBadger Reports]]\\ | [[PGBadgerReports| PGBadger Reports]]\\ | ||
+ | |||
+ | ==== pg_repack ==== | ||
+ | === AWS Instructions === | ||
+ | https:// | ||
+ | === Download === | ||
+ | For PostgreSQL 14 on AWS, use version 1.4.7. \\ | ||
+ | https:// | ||
+ | === Installation === | ||
+ | https:// | ||
+ | <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 postgresql> | ||
+ | CREATE EXTENSION pg_repack; | ||
+ | </ | ||
+ | |||
+ | === 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 '' | ||
+ | |||
+ | <code bash> | ||
+ | cd pg_repack-1.4.5/ | ||
+ | ./pg_repack -k -h localhost -U postgres -D -t football.teams doob | ||
+ | </ |
postgresqlextensions.1709306297.txt.gz · Last modified: 2025/03/08 22:23 (external edit)