Skip to content

Instantly share code, notes, and snippets.

View sebastianwebber's full-sized avatar
🏠
Working from home

Sebastian Webber sebastianwebber

🏠
Working from home
View GitHub Profile
@sebastianwebber
sebastianwebber / README.md
Last active July 16, 2026 01:51
PostgreSQL 18.4 reltuples Infinity reproducer

PostgreSQL 18.4: pg_restore_relation_stats() accepts reltuples = Infinity and writes non-finite catalog stats

PostgreSQL version

  • PostgreSQL 18.4 (Docker image postgres:18.4)

Platform

Docker on Linux/macOS (tested via a single container repro script)

@sebastianwebber
sebastianwebber / .gitignore
Last active March 10, 2026 03:39
PostgreSQL Bug: `recovery_target_action=pause` silently ignored when `RUNNING_XACTS` has `subxid_overflow=true`
subxid-overflow-repro
@sebastianwebber
sebastianwebber / README.md
Last active February 13, 2026 20:27
PG 17.8 standby crashes during WAL replay from 17.5 primary: "could not access status of transaction"

17.8 standby crashes during WAL replay from 17.5 primary: "could not access status of transaction"

PostgreSQL version

  • Primary: PostgreSQL 17.5 (Debian 17.5-1.pgdg130+1) on aarch64-unknown-linux-gnu
  • Standby: PostgreSQL 17.8 (Debian 17.8-1.pgdg13+1) on aarch64-unknown-linux-gnu

Platform

Docker containers on macOS (Apple Silicon / aarch64), Docker Desktop

@sebastianwebber
sebastianwebber / README.md
Last active September 19, 2025 14:15
Compilation of the Uber Facts on PostgreSQL to MySQL Migration

Uber facts

Original posts/information

Key points

  • ~50GB MySQL Application
  • Main motivation: PostGis
  • Migration made with a custom tool(xml2pgcopy) and mysqldump on 45min
@sebastianwebber
sebastianwebber / readme.md
Created June 26, 2020 17:36
How to install buildah on ubuntu 20.04

install-buildah-ubuntu-20.04.md

. /etc/os-release
sudo sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"
wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_${VERSION_ID}/Release.key -O Release.key
sudo apt-key add - < Release.key
sudo apt-get update -qq
sudo apt-get -qq -y install buildah
``
@sebastianwebber
sebastianwebber / top-10-tables_by-size.sql
Created January 2, 2015 11:43
Listando as 10 maiores tabelas no PostgreSQL
WITH table_stats AS (
SELECT
schemaname,
tablename,
pg_relation_size(schemaname || '.'|| tablename) as table_size,
(pg_total_relation_size(schemaname || '.'|| tablename) - pg_relation_size(schemaname || '.'|| tablename)) as index_size,
pg_total_relation_size(schemaname || '.'|| tablename) as total_size
FROM
pg_tables
)
@sebastianwebber
sebastianwebber / pg-notify-parallel.go
Last active September 19, 2024 02:43
postgres listen/notifiy with golang and `go-pg`
package main
import (
"log"
"time"
"github.com/go-pg/pg"
)
const maxWorkers = 5
@sebastianwebber
sebastianwebber / README.md
Last active February 28, 2024 20:03
PGPool II and PostgreSQL 9.5 on Centos 7

PGPool II and PostgreSQL 9.5 on Centos 7

About the virtual machines and network details, see this blog post

Instalation

Run on both servers:

yum install postgresql95-server postgresql95-contrib pgpool-II-95
@sebastianwebber
sebastianwebber / README.md
Last active June 25, 2023 00:43
9.3.5 build on centos 7

9.3 build on centos 7

Dependencies

yum install -y wget systemtap-sdt-devel gcc make bison flex perl-devel perl-ExtUtils-Embed readline-devel zlib-devel python-devel openssl-devel pam-devel libxml2-devel libxslt-devel openldap-devel tcl-devel

compiling

@sebastianwebber
sebastianwebber / show-locks.sql
Last active May 8, 2023 12:44
Show locked tables in postgreSQL
-- tested in PostgreSQL 8.4.4
DROP VIEW IF EXISTS vw_all_table_locks CASCADE;
CREATE VIEW vw_all_table_locks AS
SELECT
pg_namespace.nspname as schemaname,
pg_class.relname as tablename,
pg_locks.mode as lock_type,
age(now(),pg_stat_activity.query_start) AS time_running
FROM pg_class
JOIN pg_locks on pg_locks.relation = pg_class.oid