GithubHelp home page GithubHelp logo

gcalacoci / pgenv Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mnencia/pgenv

0.0 2.0 0.0 9 KB

Personal collection of shell scripts to easily develop and test several PostgreSQL at once.

License: MIT License

Emacs Lisp 7.97% Shell 92.03%

pgenv's Introduction

Pgenv

This is a personal collection of shell scripts to easily develop and test several PostgreSQL at once.

Install

Checkout the project in $HOME/pgsql

git clone https://github.com/mnencia/pgenv.git $HOME/pgsql

Add the following lines to ~/.bashrc

# pgenv
if [ -r "$HOME/pgsql/pgenv.sh" ] ; then
    . "$HOME/pgsql/pgenv.sh"
fi

Reload the current shell

exec bash

Install master version (required)

Initial postgresql checkout

git clone git://git.postgresql.org/git/postgresql.git $HOME/pgsql/master

In Ubuntu, install these packages, which are necessary for configure-all.sh

sudo apt-get install tcl-dev libssl-dev build-essential bison flex \
    libreadline-dev libxml2-dev

If you use openSUSE, you must install these packages:

sudo zypper in -t pattern devel_C_C++
sudo zypper in tcl-devel libxml2-devel readline-devel libopenssl-devel

If you use Archlinux, please be sure that these packages are installed:

sudo pacman -S tcl libxml2 openssl bison flex base-devel

Build and install the development head version

cd ~/pgsql
./configure-all.sh master
./install-all.sh master

Install a stable version (optional)

Add a $VERSION checkout (e.g. 9.4, 9.3, etc...)

cd ~/pgsql
./new-branch.sh $VERSION

Build and install the $VERSION version

cd ~/pgsql
./configure-all.sh $VERSION
./install-all.sh $VERSION

Upgrade an existing installation

Upgrade all the installed versions

cd ~/pgsql
./pull-all.sh
./clean-all.sh
./configure-all.sh
./install-all.sh

Upgrade only one version (numeric version or master)

cd ~/pgsql
./pull-all.sh
./clean-all.sh $VERSION
./configure-all.sh $VERSION
./install-all.sh $VERSION

Usage

pgworkon

Usage: pgworkon VERSION [COMMAND]

set the environment to use the specific version, if a COMMAND is specified, execute it in the target environment but leave the current environment untouched

There are four special commands to be executed directly using pgworkon: start, stop, restart, reinit This allows to use the following syntax to control the execution status of a version

pgworkon $VER {start|stop|restart|reinit}

pgreinit

Usage: pgreinit

destroy the current $PGDATA and run initdb again, , available only after a pgworkon call

pgstop, pgstart, pgrestart

controls the state of the current environment, available only after a pgworkon call

pgdeactivate

reset the state and exit from any environment

pgstatus

list the running instances

pgenv's People

Contributors

mnencia avatar

Watchers

 avatar  avatar

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.