Skip to content

Instantly share code, notes, and snippets.

@aliyome
Last active July 22, 2018 06:24
Show Gist options
  • Save aliyome/e0504b4afb614d976dd1 to your computer and use it in GitHub Desktop.
Save aliyome/e0504b4afb614d976dd1 to your computer and use it in GitHub Desktop.

ddbcのpostgresql対応が思いの外しょぼかったので頓挫

#server
echo deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main >> /etc/apt/sources.list
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
apt-get update
apt-get install postgresql

#!!!!!!!!
# no test
#!!!!!!!!
# accept all connection 
mkdir ~/backup
cp /etc/postgresql/9.3/main/postgresql.conf ~/backup/postgresql.conf
sed -e "s/#listen_addresses = 'localhost'/listen_addresses = '*'/" ~/backup/postgresql.conf > /etc/postgresql/9.3/main/postgresql.conf

cp /etc/postgresql/9.3/main/pg_hba.conf ~/backup/pg_hba.conf
sed -e "/# IPv4 local connections:/a\n\
host all all 0.0.0.0/0 trust
" ~/backup/pg_hba.conf > /etc/postgresql/9.3/main/pg_hba.conf

# client
apt-get install postgresql-client
apt-get install libpq-dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment