Skip to content

Instantly share code, notes, and snippets.

View snaga's full-sized avatar

Satoshi Nagayasu snaga

View GitHub Profile
# ----------------------------------------------------------------
# Makefile for building PostgreSQL
#
# Copyright(C) 2010 Satoshi Nagayasu <[email protected]>
# ----------------------------------------------------------------
PREFIX=/usr/local/pgsql90b1
POSTGRES=postgresql-9.0beta1
CONTRIBS=pgbench
diff -rc pg_lesslog_1.4.2_pg90.orig/log.c pg_lesslog_1.4.2_pg90/log.c
*** pg_lesslog_1.4.2_pg90.orig/log.c Tue Jun 8 14:25:52 2010
--- pg_lesslog_1.4.2_pg90/log.c Fri Oct 28 13:43:12 2011
***************
*** 20,25 ****
--- 20,26 ----
#include "postgres.h"
#include "access/clog.h"
#include "access/gin.h"
+ #include "access/gin_private.h"
@snaga
snaga / repmgr.spec.diff
Created April 3, 2012 01:55
repmgr.spec.diff
*** repmgr.spec.orig 2012-04-02 16:28:48.000000000 +0900
--- repmgr.spec 2012-04-03 10:47:50.000000000 +0900
***************
*** 5,10 ****
--- 5,11 ----
Version: 1.1.0
Release: 1%{?dist}
Summary: Replication Manager for PostgreSQL Clusters
+ Group: Applications/Databases
@snaga
snaga / test_gettimeofday.c
Created July 12, 2012 12:51
test code to measure cost of gettimeofday() call.
#include <stdio.h>
#include <sys/time.h>
int
main(void)
{
int i, j;
struct timeval s,e;
struct timeval t;
float avg;
@snaga
snaga / doc_sgml_cmp.pl
Created September 5, 2012 06:13
A script to summarize PostgreSQL documentation changes in SGML files between two PostgreSQL versions
#!/usr/bin/perl
# -------------------------------------------------------------
# doc_sgml_cmp.pl
#
# A script to summarize PostgreSQL documentation changes
# in SGML files between two PostgreSQL versions.
#
# Written by Satoshi Nagayasu <[email protected]>
# -------------------------------------------------------------
@snaga
snaga / gist:3751119
Created September 19, 2012 17:57
About the JPUG event on November 30, 2012.
Our previous event, which is similar to the next one,
was PostgreSQL Conference 2012 Tokyo on Feb 24.
To help you understand how our event runs, you can see
the previous program and pics here:
http://pgsnaga.blogspot.jp/2012/01/postgresql-conference-2012-on-february.html
http://www.flickr.com/photos/koyhoge/sets/72157629486055555/
The next one would be a bit smaller than the previous one.
@snaga
snaga / alternatives-pgsql
Created October 6, 2012 13:31
Switch postgresql version for all the commands with using alternatives.
#!/bin/sh
# alternatives-pgsql
#
# Switch postgresql version for all the commands with using alternatives.
#
# Copyright(C) 2012 Uptime Technologies, LLC. All rights reserved.
PATH=/usr/sbin:$PATH
export PATH
@snaga
snaga / gist:4179435
Created November 30, 2012 23:25
check_pg_settings.sql
--
-- check_pg_settings.sql
--
-- Copyright(C) 2012 Uptime Technologies, LLC. All rights reserved.
--
SELECT name,
setting,
CASE WHEN setting::integer = 4096 THEN 'WARNING: default value (4096=32MB) is too small.'
WHEN setting::integer < 65536 THEN 'WARNING: too small. (<65536=512MB)'
ELSE 'OK.'
@snaga
snaga / dl.sh
Created December 13, 2012 03:10
a download script for postgresql rpm files.
#!/bin/sh
wget http://yum.postgresql.org/9.2/redhat/rhel-6.3-i386/postgresql92-9.2.1-1PGDG.rhel6.i686.rpm
wget http://yum.postgresql.org/9.2/redhat/rhel-6.3-i386/postgresql92-contrib-9.2.1-1PGDG.rhel6.i686.rpm
wget http://yum.postgresql.org/9.2/redhat/rhel-6.3-i386/postgresql92-debuginfo-9.2.1-1PGDG.rhel6.i686.rpm
wget http://yum.postgresql.org/9.2/redhat/rhel-6.3-i386/postgresql92-devel-9.2.1-1PGDG.rhel6.i686.rpm
wget http://yum.postgresql.org/9.2/redhat/rhel-6.3-i386/postgresql92-docs-9.2.1-1PGDG.rhel6.i686.rpm
wget http://yum.postgresql.org/9.2/redhat/rhel-6.3-i386/postgresql92-libs-9.2.1-1PGDG.rhel6.i686.rpm
wget http://yum.postgresql.org/9.2/redhat/rhel-6.3-i386/postgresql92-plperl-9.2.1-1PGDG.rhel6.i686.rpm
wget http://yum.postgresql.org/9.2/redhat/rhel-6.3-i386/postgresql92-plpython-9.2.1-1PGDG.rhel6.i686.rpm
@snaga
snaga / gist:5954426
Created July 9, 2013 03:18
rank_top_reviewers.pl
#!/usr/bin/perl
my %review;
open(F, "wget -q -O - https://commitfest.postgresql.org/action/commitfest_view/inprogress | ") || die($!);
my $count = 0;
while(<F>)
{
if ( /td/ && /colMidT/ )
{