Skip to content

Instantly share code, notes, and snippets.

View ajepe's full-sized avatar
🏠
Working from home

Babatope Ajepe ajepe

🏠
Working from home
View GitHub Profile
@ajepe
ajepe / upgrade-postgres-9.6-to-10.md
Created November 8, 2019 14:37 — forked from mdesantis/upgrade-postgres-9.6-to-10.md
Upgrading PostgreSQL from 9.6 to 10 on Ubuntu 16.04

TL;DR

Install Postgres 10, and then:

sudo pg_dropcluster 10 main --stop
sudo pg_upgradecluster 9.6 main
sudo pg_dropcluster 9.6 main
@ajepe
ajepe / psql_encoding.markdown
Created August 8, 2018 10:44 — forked from joshteng/psql_encoding.markdown
This solves Postgresql's encoding issue (happened to me when running postgres on my vagrant box) The error happens when trying to create db "rake db:create": Error message: "encoding UTF8 does not match locale en_US; the chosen LC_CTYPE setting requires encoding LATIN1"
sudo su postgres
psql
update pg_database set datistemplate=false where datname='template1';
drop database Template1;
create database template1 with owner=postgres encoding='UTF-8' lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0;
update pg_database set datistemplate=true where datname='template1';