Coder Social home page Coder Social logo

pgenv's Introduction

pgenv

pgenv is a tiny tool that helps install various versions of PostgreSQL on bash.

Install

git clone https://github.com/moritoru81/pgenv.git
source pgenv/install.sh

or

git clone https://github.com/moritoru81/pgenv.git
cat <<EOS >> ~/.bash_profile
### start pgenv
source `pwd`/pgenv/profile
export PATH=`pwd`/pgenv/bin:\$PATH
### end pgenv
EOS
touch `pwd`/pgenv/profile
source ~/.bash_profile

Install PostgreSQL

pgenv install --g3 9.6.3
pgenv shell 9.6.3       # exec $SHELL
pgenv global 9.6.3
psql -V

Diff

pgenv diff 9.5.6:9.6.3:src/backend/parser/analyze.c | less -R
# @ is current version
pgenv diff 9.5.6:@:src/backend/parser/analyze.c | less -R

Edit

EDITOR=vim pgenv edit @:src/backend/parser/analyze.c

Find and Grep

pgenv grep @:src/backend/parser:'_hook'

Show versions

pgenv directories

Switch version temporarily

pgenv select

Others

# Show prefix
pgenv prefix            # => /path/to/versions/current_version
pgenv prefix 9.5.1      # => /path/to/versions/9.5.1
# Create a database cluster with version 9.5.1
$(pgenv prefix 9.5.1)/bin/initdb db95

Configure option

By default, pgenv uses file 'configure_default_options'. But also you can use definitions for the specified version.

# If the option file for the specified version, it's used.
configure_default_options-9.6.3
# Otherwise, the default option file.
configure_default_options

pgenv's People

Contributors

moritetu avatar

Stargazers

Tobias Wolf avatar

Watchers

James Cloos avatar  avatar

Forkers

kmrmshk

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.