View gist:fbbdfe646427710233ecb67569665de9
pgbfprod=> select s.branch, s.log_stage, count(*), avg(extract(epoch from stage_duration)::numeric(15,2))::numeric(15,1), stddev(extract(epoch from stage_duration)::numeric(15,2))::numeric(15,1) from public.build_status_log s where sysname <> 'crake' and snapshot > now() - interval '10 days' and log_stage !~ 'start|stop' group by s.branch, s.log_stage having count(*) > 20 and avg(extract(epoch from stage_duration)::numeric(15,2)) > 20 order by log_stage, branch <> 'HEAD', branch desc
;
branch | log_stage | count | avg | stddev
---------------+-----------------------------------------------+-------+--------+--------
HEAD | bin-check.log | 388 | 1739.0 | 1758.5
REL9_6_STABLE | bin-check.log | 91 | 1430.5 | 1287.9
REL9_5_STABLE | bin-check.log | 87 | 1140.0 | 994.1
REL9_4_STABLE | bin-check.log | 72 | 751.0 | 66
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";