Skip to content

Instantly share code, notes, and snippets.

View DavidGoussev's full-sized avatar

David Goussev DavidGoussev

View GitHub Profile
@supix
supix / postgres_recovery.md
Last active November 4, 2025 14:44
Postgres error: Missing chunk 0 for toast value in pg_toast

The problem

In some cases, it is possible that PostgreSQL tables get corrupted. This can happen in case of hardware failures (e.g. hard disk drives with write-back cache enabled, RAID controllers with faulty/worn out battery backup, etc.), as clearly reported in this wiki page. Furthermore, it can happen in case of incorrect setup, as well.

One of the symptoms of such corruptions is the following message:

ERROR: missing chunk number 0 for toast value 123456 in pg_toast_45678

This almost surely indicates that a corrupted chunk is present within a table file. But there is a good way to get rid of it.

@brock
brock / pg_extract.sh
Last active October 21, 2024 21:23
Extract all databases (or one by name) from a sql file created by pg_dumpall
#!/bin/bash
# extract all postgres databases from a sql file created by pg_dumpall
# this script outputs one .sql file for each database in the original .sql file
# unless you pass the name of a database in the dump
if [ $# -lt 1 ]
then
echo "Usage: $0 <postgresql sql dump> [dbname]" >&2
exit 1
fi
@rickyPanzer
rickyPanzer / introducing-help-form.md
Last active September 7, 2015 04:12
Introducing Help Forum

A couple of us mentors created Help Forum, which is Stack Overflow, but for the student and mentor community. If interested sign up at the site here https://help-forum.wearementors.io and email at me ([email protected]) so I can approve you.

##Introductory Message

Hi fellow students and mentors,

My name is Ricky. I am a Rails and iOS mentor here at Bloc. As a mentor, I've been guiding my students to several different channels for help. For my students, two strategies have been the most helpful: Google && Stack Overflow and Curriculum specific slack groups. The Bloc Hacker Group on Facebook, Bloc Overflow, and Basecamp have also proven helpful.

Google and Stack Overflow
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active October 31, 2025 16:45
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: