This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@dev-postgres:/var/lib/postgresql/pg_repack# make | |
make[1]: Entering directory `/var/lib/postgresql/pg_repack/bin' | |
gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -I/usr/include/mit-krb5 -fPIC -pie -DLINUX_OOM_SCORE_ADJ=0 -fno-omit-frame-pointer -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g pg_repack.o pgut/pgut.o pgut/pgut-fe.o -L/usr/lib/x86_64-linux-gnu -lpq -L/usr/lib/x86_64-linux-gnu -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -L/usr/lib/mit-krb5 -L/usr/lib/x86_64-linux-gnu/mit-krb5 -L/usr/lib/x86_64-linux-gnu -Wl,--as-needed -lpgport -lpgcommon -lssl -lcrypto -lkrb5 -lcom_err -lgssapi_krb5 -lz -ledit -lcrypt -ldl -lm -o pg_repack | |
/usr/bin/ld: cannot find -ledit | |
collect2: ld returned 1 exit status | |
make[1]: *** [pg_repack] Error 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
h2.name AS "objectcsid", | |
cc.objectnumber, | |
h1.name AS "mediacsid", | |
mc.description, | |
bc.name, | |
mc.creator creatorRefname, | |
REGEXP_REPLACE(mc.creator, '^.*\)''(.*)''$', '\1') AS "creator", | |
mc.blobcsid, | |
mc.copyrightstatement, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# docker compose file for running a 3-node PostgreSQL cluster | |
# with etcd as the SIS | |
etcd: | |
image: quay.io/coreos/etcd | |
ports: | |
- "2379" | |
- "2380" | |
- "4001" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH | |
write_adjust AS ( | |
-- change the below to 1.0 if pg_stats goes back to | |
-- the creation of the database | |
SELECT 0.0 AS adjustment | |
), | |
index_usage AS ( | |
SELECT sut.relid, | |
current_database() AS database, | |
sut.schemaname::text as schema_name, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- function for doing dictionary-style replacement of varaibles | |
-- in a SQL string. variables are marked in the text with ${var} | |
-- and replaced using a json dictionary | |
create or replace function replace_vars ( somestring text, | |
vars JSON ) | |
returns text | |
language plpgsql | |
immutable | |
as |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/user/bin/env python | |
import psycopg2 | |
import datetime | |
import random | |
import time | |
import sys | |
def randuser(): | |
return (int(random.random() * 100) + 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from TwitterAPI import TwitterAPI | |
import psycopg2 | |
from psycopg2.extras import Json | |
CONSUMER_KEY = 'Get' | |
CONSUMER_SECRET = 'your' | |
ACCESS_TOKEN_KEY = 'own' | |
ACCESS_TOKEN_SECRET = 'API key' | |
api = TwitterAPI(CONSUMER_KEY, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
benchcall = "{bdir}/{pgb} -T {ttime} -c {clients} -j {jobs} -s {scale} -r -n {scriptfiles} -p {port} -U {user} -h {host} {dbname} > {results}.results".format(bdir=abench,pgb=pgbench,ttime=numsec,clients=numclients,jobs=numthreads,scale=numrows,scriptfiles=filelist,dbname=db,results=abench,port=dbport,user=dbuser,host=dbhost) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create type numeric_quartiles_plus as ( | |
min float, | |
q05 float, | |
q10 float, | |
q25 float, | |
q50 float, | |
q75 float, | |
q90 float, | |
q95 float, | |
max float, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create type numeric_quartiles_plus as ( | |
min float, | |
q05 float, | |
q10 float, | |
q25 float, | |
q50 float, | |
q75 float, | |
q90 float, | |
q95 float, | |
max float, |