View Gen_dummy_probes.pl
#!/usr/bin/perl -w
eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
if 0;
$0 =~ s/^.*?(\w+)[\.\w+]*$/$1/;
use strict;
use Symbol;
use vars qw{ $isEOF $Hold %wFiles @Q $CondReg
$doAutoPrint $doOpenWrite $doPrint };
$doAutoPrint = 1;
View gist:d8e6193a60ad39e9ff12
package main
import (
"database/sql"
"log"
_ "github.com/lib/pq"
"fmt"
)
func main() {
View 20mirror-outside-files
#!/bin/sh
set -e
# Based on nealmcb's + ErebusBat's script from http://serverfault.com/questions/211425/
# put this file in etckeeeper's commit.d directory
# in the config file set MIRROR_ROOT (somewhere under /etc) MIRROR_FILES and MIRROR_DIRS
# the latter two can contain wildcards
# all three symbols must be exported or they won't be seen by this script
View gist:3ae53e8b27a8205d2379
with recursive
dag (depended_on,dependent) as
(
values
('b2'::text,'d1'::text),
('d1','d2'),
('d2','d3'),
('d3','d4'),
('b1','a1'),
('b2','a1'),
View gist:ec87e7892c9de98d4731
-- run after end of deploy transaction
select string_agg('vacuum freeze analyse ' || oid::regclass || ';', '') as all_vacs
from pg_class
where relkind in ('r','m')
and relnamespace not in (select oid
from pg_namespace
where nspname in ('pg_catalog','information_schema','sqitch')) \gset
:all_vacs
View sql_json_comparison_ops.sql
CREATE OR REPLACE FUNCTION json_cmp(left json, right json)
RETURNS integer AS $$
select bttextcmp($1::text, $2::text)
$$ LANGUAGE sql IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION json_eq(json, json)
RETURNS BOOLEAN LANGUAGE SQL STRICT IMMUTABLE AS $$
SELECT json_cmp($1, $2) = 0;
$$;
View vacuum_schema.sql
-- requires dblink extension the be installed
-- vacuum a schema via dblink
create or replace function vacuum_schema(schemaname text)
returns void
language plpgsql
as
$func$
declare
View json_utf8_pix.patch
diff --git a/src/backend/utils/adt/json.c b/src/backend/utils/adt/json.c
index aaf99bd..2092b60 100644
--- a/src/backend/utils/adt/json.c
+++ b/src/backend/utils/adt/json.c
@@ -646,6 +646,7 @@ json_lex_string(JsonLexContext *lex)
{
char *s;
int len;
+ int hi_surrogate = -1;
View explain_url.sql
CREATE OR REPLACE FUNCTION public.explain_url(query text)
RETURNS text
LANGUAGE plperlu
AS $function$
my $query = shift;
elog(ERROR,"not an explain query") unless $query =~ /^\s*explain\s/i;
my $rv = spi_exec_query($query);
my $nrows = $rv->{processed};
my $text = $query . "\n QUERY PLAN\n-------------------\n";
View Dist.pm
package PGBuild::Modules::Dist;
use PGBuild::Options;
use PGBuild::SCM;
use strict;
use vars qw($VERSION); $VERSION = 'REL_4.6';
my $hooks = {