Skip to content

Instantly share code, notes, and snippets.

View ringerc's full-sized avatar

Craig Ringer ringerc

View GitHub Profile
@ringerc
ringerc / jpegify.py
Last active December 10, 2015 04:13
#!python
# coding=utf-8
#
# usage: python jpegify.py *.pdf
#
# Written for Python 2 or python 3
from __future__ import print_function
import os
@ringerc
ringerc / schema.sql
Created February 8, 2016 14:34
Demo Python script for replicating to Solr
CREATE TABLE book_lines
(
id serial primary key,
book_line text not null
);
@ringerc
ringerc / pg_elephant.c
Created May 18, 2016 13:16
pg_elephant()
#include "postgres.h"
#include "fmgr.h"
PG_MODULE_MAGIC;
PGDLLEXPORT Datum pg_elephant(PG_FUNCTION_ARGS);
PG_FUNCTION_INFO_V1(pg_elephant);
static const char * const elephant =
"............MMMMMMMMMMM8..........MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM ...........\n"
From a7a69e8dc87504163222ba2570bda6920114a5c3 Mon Sep 17 00:00:00 2001
From: Craig Ringer <craig@redacted>
Date: Sun, 26 Jun 2016 19:58:48 +0800
Subject: [PATCH] SPK utils build fixes
---
.gitignore | 4 ++++
src/SPK/File_IO.cpp | 2 ++
src/SPK/Makefile | 9 +++++----
src/SPK/String.h | 3 +++
@ringerc
ringerc / gist:d4a8fe97f5fd332d8b883d596d61e257
Created August 11, 2017 02:56
Failover slots with streaming rep proto
Phys rep Phys rep
using phys using
slot "B" phys slot "C"
+-------+ +--------+ +-------+
T | A <^--------+ B <---------+ C |
I | | | | | |
M +-------+ +--------+ +-------+
E | | |
| | | |CREATEs
| | | |logical slot X
BEGIN;
SET LOCAL bdr.skip_ddl_locking=on;
SET LOCAL bdr.skip_ddl_replication=on;
CREATE OR REPLACE FUNCTION public.simple_log_row()
RETURNS trigger LANGUAGE plpgsql
SET search_path = 'pg_catalog'
AS $$
BEGIN