Skip to content

Instantly share code, notes, and snippets.

View eulerto's full-sized avatar

Euler Taveira eulerto

View GitHub Profile
@eulerto
eulerto / postgres-non-default-settings
Last active September 10, 2020 10:06
PostgreSQL non-default settings + version
SELECT name, current_setting(name), source, sourcefile, sourceline FROM pg_settings WHERE (source <> 'default' OR name = 'server_version') AND name NOT IN ('config_file', 'data_directory', 'hba_file', 'ident_file');
@eulerto
eulerto / pgbouncer-1-9-wrapper
Created February 14, 2019 17:09
PgBouncer 1.9 wrapper using dblink_fdw and views.
CREATE SERVER pgbouncer FOREIGN DATA WRAPPER dblink_fdw OPTIONS(host 'localhost', port '6432', dbname 'pgbouncer');
CREATE USER MAPPING FOR PUBLIC SERVER pgbouncer OPTIONS(user 'postgres');
CREATE SCHEMA IF NOT EXISTS pgbouncer;
CREATE VIEW pgbouncer.active_sockets AS
SELECT a.type,
a."user",
a.database,
--
-- CentOS
--
sudo yum update -y
sudo yum groupinstall "Development Tools"
sudo yum install -y cmake
--
-- go to https://yum.postgresql.org/repopackages.php
--
#!/bin/bash
# pgquarrel source
PGQPATH=$HOME/pgquarrel
# Ubuntu 18.04 (bionic)
#ORIGPATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
# Ubuntu 16.04 (xenial)
#ORIGPATH=/home/ubuntu/bin:/home/ubuntu/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
# Debian (stretch)