Giter Club home page Giter Club logo

homebrew-postgresql's Introduction

Homebrew PostgreSQL things

These formulae allow installing multiple versions of PostgreSQL in parallel. This is similar to what you can do on certain Linux distributions, for example Debian.

Just brew tap petere/postgresql and then brew install <formula>.

Build Status

Details

Since PostgreSQL major releases have incompatible data directories and other occasional incompatibilities, it is useful for many developers to keep several major versions installed in parallel for development, testing, and production. So far, Homebrew had inconsistent support for that and did not provide the full range of supported major versions. This tap provides versioned formulae named [email protected], [email protected], etc. that you can install in parallel. Technically, these are "keg-only", which has the nice side effect that they are automatically installed in side-by-side directories /usr/local/opt/[email protected]/ etc.

To use the programs installed by these formulae, do one or more of the following, in increasing order of preference:

  • Call all programs explicitly with /usr/local/opt/[email protected]/bin/.... This will be boring in the long run.
  • Add your preferred /usr/local/opt/[email protected]/bin etc. to your path. Preferably to the front, to come before the operating system's PostgreSQL installation. This will work alright, but depending on your setup, it might be difficult to get everything on the OS to see the same path.
  • brew link -f the [email protected] formula you prefer to use.
  • Install the postgresql-common package (see below).

The versioned formulae can be installed alongside the main postgresql formula in Homebrew. But there will be a conflict if you do brew link -f or install postgresql-common, so in those cases you have to uninstall the main postgresql package first. This is not a problem, however, because the versioned packages provide the same functionality.

Build options

The standard postgresql formula in Homebrew is missing a number of build options and also has a number of build options that I find useless. These formulae enable all configure options that macOS can support, but also remove a number of Homebrew-level build options, to reduce complexity. I have also dropped supported for legacy macOS concerns, such as 32-bit Intel and PowerPC and really old macOS releases. Mainly because I can't test that anymore, YMMV.

postgresql-common cluster manager

postgresql-common is a port of the postgresql-common package from Debian, which contains programs that help manage these multiple versioned installations, and programs to manage multiple PostgreSQL instances (clusters). The port a bit experimental, but it works.

See /usr/local/opt/postgresql-common/README.Debian to get started. If you have used Debian or Ubuntu before, you'll feel right at home (I hope).

The general idea is that for server-side operations you use the special wrapper scripts pg_createcluster, pg_dropcluster, pg_ctlcluster, and pg_lsclusters instead of initdb and pg_ctl. The scripts take version numbers and instance names (which map to directory names). For example:

pg_createcluster 9.6 test
pg_ctlcluster 9.6 test start

See the respective man pages for details.

For client-side operations, to usual tools such as psql and pg_dump are wrapped to automatically use the right version for the instance they are connecting to, so you usually don't need to do anything special. See the man page pg_wrapper for details.

Extensions

To install extensions, I recommend Pex. It has support for multiple PostgreSQL installations and can easily support to the installation scheme used by these packages. Example:

pex -g /usr/local/opt/[email protected] install ip4r

homebrew-postgresql's People

Contributors

petere avatar kevinji avatar webervin avatar jasonmp85 avatar j3rn avatar vinbarnes avatar

Watchers

James Cloos 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.