{"id":23394859,"url":"https://github.com/guedes/pgvm","last_synced_at":"2025-04-11T12:54:25.945Z","repository":{"id":3483457,"uuid":"4539034","full_name":"guedes/pgvm","owner":"guedes","description":"PostgreSQL Version Manager","archived":false,"fork":false,"pushed_at":"2016-05-02T00:46:51.000Z","size":512,"stargazers_count":122,"open_issues_count":13,"forks_count":21,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T09:12:03.998Z","etag":null,"topics":["postgresql","rvm","version"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/guedes.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-06-03T17:21:16.000Z","updated_at":"2025-01-16T14:44:19.000Z","dependencies_parsed_at":"2022-08-24T09:00:34.997Z","dependency_job_id":null,"html_url":"https://github.com/guedes/pgvm","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guedes%2Fpgvm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guedes%2Fpgvm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guedes%2Fpgvm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guedes%2Fpgvm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guedes","download_url":"https://codeload.github.com/guedes/pgvm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248403949,"owners_count":21097621,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["postgresql","rvm","version"],"created_at":"2024-12-22T06:18:21.842Z","updated_at":"2025-04-11T12:54:25.916Z","avatar_url":"https://github.com/guedes.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://secure.travis-ci.org/guedes/pgvm.png?branch=master)](http://travis-ci.org/guedes/pgvm)\n\nPostgreSQL Version Manager - pgvm\n==================================\n\nPostgreSQL Version Manager, or simply `pgvm` is a tool to manage multiple PostgreSQL installations.\n\nInstallation\n------------\n\nTo install just type:\n\n    curl -s -L https://raw.github.com/guedes/pgvm/master/bin/pgvm-self-install | bash\n\nThen open a new terminal or type `source ~/.bashrc` on Linux, or `source ~/.bash_profile` on OS X and voilà!\n\nIf you want to install it in another directory you could pass it to `--pgvm-home` like this:\n\n    curl -s -L https://raw.github.com/guedes/pgvm/master/bin/pgvm-self-install  | bash -s -- --pgvm-home=/usr/local/pgvm\n\nOSes\n----\n\n`pgvm` was tested on Debian and OS X, please open a issue if you find a bug on this OSes\n\n\nAn example session\n------------------\n\nOnce you installed `pgvm` you could like to see which\nPostgreSQL versions were installed. In fact the `pgvm`\ninstallation didn't install any.\n\nYou list all PostgreSQL installed version with the\naction `list`:\n\n    $ pgvm list\n    Please install some PostgreSQL version using 'pgvm install'!\n\nAs you can see, there isn't any. Lets install one\nusing the action `install`:\n\n    $ pgvm install 9\n    downloading 'http://ftp.postgresql.org/pub/source/v9.2.0/postgresql-9.2.0.tar.gz', please be patient... done.\n    checking 'postgresql-9.2.0.tar.gz' integrity... done.\n    extracting postgresql-9.2.0.tar.gz ... done.\n    configuring PostgreSQL Version: 9.2.0 ... done.\n    compiling ... done.\n    installing ... done.\n\nNotice that the version supplied was `9` but `pgvm`\nfound that the last PostgreSQL version is `9.2.0`.\n\nNow suppose we want to install the `8.4.11` version\nwith `cassert` enabled, using more cores of our\nprocessors, just export `MAKE_OPTS` and `CONFIG_OPTS`\nwith the options for `make` and `configure` respectively,\nlike bellow:\n\n    $ MAKE_OPTS=\"-j 10\" CONFIG_OPTS=\"--enable-cassert\" pgvm install 8.4.11\n    downloading 'http://ftp.postgresql.org/pub/source/v8.4.11/postgresql-8.4.11.tar.gz', please be patient... done.\n    checking 'postgresql-8.4.11.tar.gz' integrity... done.\n    extracting postgresql-8.4.11.tar.gz ... done.\n    configuring PostgreSQL Version: 8.4.11 ... done.\n    compiling ... done.\n    installing ... done.\n\nSo now you have two PostgreSQL versions installed:\n\n    $ pgvm list\n    PostgreSQL Installed Version:\n\n        8.4.11\n        9.2.0\n\nThen `pgvm` allow you `use` one of them:\n\n    $ pgvm use 92.0\n    version 92.0 is not installed\n\nOps! A little typo, sorry! :/\n\n    $ pgvm use 9.2.0\n    switched to 9.2.0\n\nAh! So now my `current` version is `9.2.0`? Well\nlets just confirm:\n\n    $ pgvm current\n    9.2.0\n\n    $ pgvm list\n    PostgreSQL Installed Version:\n\n        8.4.11\n     =\u003e 9.2.0\n\nSeems that `pgvm` tell us in two ways, by the\naction `current` or when listing version by\nplacing a `=\u003e` before the version we are using!\n\nThe binaries are there in the correct version:\n\n    $ pg_config --version\n    PostgreSQL 9.2.0\n\n    $ psql --version\n    psql (PostgreSQL) 9.2.0\n\n    $ pgvm use 8.4.11\n\n    $ pg_config --version\n    PostgreSQL 8.4.11\n\n    $ psql --version\n    psql (PostgreSQL) 8.4.11\n\nOk, this is nice but how about clusters? Lets\ncreate one!\n\n    $ pgvm use 9.2.0\n    switched to 9.2.0\n\n    $ pgvm cluster list\n    there is no clusters in current environment (9.2.0)\n\n    $ pgvm cluster create my_cluster\n    initializing cluster in '/home/guedes/pgvm/clusters/9.2.0/my_cluster'... ok!\n\n    $ pgvm cluster start my_cluster\n    starting cluster my_cluster@9.2.0\n    LOG:  database system was shut down at 2012-09-22 21:55:03 UTC\n    LOG:  database system is ready to accept connections\n    LOG:  autovacuum launcher started\n\n    $ pgvm cluster list\n    cluster in current enviroment (9.2.0):\n\n        my_cluster  is online  at port 5433\n\n    $ pgvm cluster create my_another_cluster\n    initializing cluster in '/home/guedes/pgvm/clusters/9.2.0/my_another_cluster'... ok!\n\n    $ pgvm cluster start my_another_cluster\n    starting cluster my_another_cluster@9.2.0\n    LOG:  database system was shut down at 2012-09-22 21:55:06 UTC\n    LOG:  database system is ready to accept connections\n    LOG:  autovacuum launcher started\n\n    $ pgvm cluster list\n    cluster in current enviroment (9.2.0):\n\n        my_another_cluster is online  at port 5434\n        my_cluster         is online  at port 5433\n\nNow we have two online clusters and notice that\n`pgvm` choose specific ports to each one.\n\nYou can pass options to `initdb` when creating\na new cluster:\n\n    $ pgvm use 8.4.11\n    switched to 8.4.11\n\n    $ pgvm cluster create latin1_cluster --encoding=latin1 --locale=en_US\n\nAnd you can remove some cluster\n\n    $ pgvm cluster create to_be_removed\n    initializing cluster in '/home/guedes/pgvm/clusters/8.4.11/to_be_removed'... ok!\n\n    $ pgvm cluster start to_be_removed\n    starting cluster to_be_removed@8.4.11\n    LOG:  database system was shut down at 2012-09-22 21:55:13 UTC\n    LOG:  database system is ready to accept connections\n    LOG:  autovacuum launcher started\n\n    $ pgvm cluster remove to_be_removed\n    To remove cluster 'to_be_removed' use  'pgvm cluster remove to_be_removed --force'\n\n    $ pgvm cluster remove to_be_removed --force\n    stopping cluster to_be_removed@8.4.11\n    LOG:  received smart shutdown request\n    LOG:  autovacuum launcher shutting down\n    LOG:  shutting down\n    LOG:  database system is shut down\n    removing 'to_be_removed' directory '/home/guedes/pgvm/clusters/8.4.11/to_be_removed' ... ok\n\nMaybe you are a PostgreSQL developer and wants to install from\n`master` branch ...\n\n    $ pgvm install master\n    getting postgres from 'git://git.postgresql.org/git/postgresql.git'\n    Cloning into '/home/guedes/pgvm/src/postgresql-clone'...\n    configuring PostgreSQL Version: master ... done.\n    compiling ... done.\n    installing ... done.\n\n    $ pgvm use master\n    switched to master\n\n    $ pgvm cluster create cl_test_master\n    initializing cluster in '/home/guedes/pgvm/clusters/master/cl_test_master'... ok!\n\n    $ pgvm cluster start cl_test_master\n    starting cluster cl_test_master@master\n    LOG:  database system was shut down at 2012-09-22 21:58:49 UTC\n    LOG:  database system is ready to accept connections\n    LOG:  autovacuum launcher started\n\n    $ pgvm cluster list\n    cluster in current enviroment (master):\n\n        cl_test_master  is online  at port 5436\n\n... or from a specific commit to test something ...\n\n    $ pgvm install 088c065\n    configuring PostgreSQL Version: 088c065 ... done.\n    compiling ... done.\n    installing ... done.\n\n    $ pgvm use 088c065\n    switched to 088c065\n\n    $ pgvm cluster create cl_test_other\n    initializing cluster in '/home/guedes/pgvm/clusters/088c065/cl_test_other'... ok!\n\n    $ pgvm cluster start cl_test_other\n    starting cluster cl_test_other@088c065\n    LOG:  database system was shut down at 2012-09-22 22:01:06 UTC\n    LOG:  database system is ready to accept connections\n    LOG:  autovacuum launcher started\n\n    $ pgvm cluster list\n    cluster in current enviroment (088c065):\n\n        cl_test_other  is online  at port 5437\n\nBy the way, you can start a console on any cluster:\n\n    $ pgvm current\n    088c065\n\n    $ pgvm console my_cluster@9.2.0\n    connecting to cluster 'test' on port '5433' ...\n\n    psql (9.2.0)\n    Type \"help\" for help.\n\n    postgres=#\n\nOr you can redirect commands to:\n\n    $ echo \"select version()\" | pgvm console latin1_cluster@8.4.11\n    connecting to cluster 'test' on port '5435' ...\n\n                                               version\n    ----------------------------------------------------------------------------------------------\n     PostgreSQL 8.4.11 on x86_64-unknown-linux-gnu, compiled by gcc (Debian 4.7.2-1) 4.7.2, 64-bit\n    (1 row)\n\n\nDependencies\n------------\n\n  `pvgm` has the following dependencies:\n\n  * `bash`\n  * `curl` or `wget`\n  * `c compiler`\n  * `gmake`\n  * `readline`\n  * `zlib`\n  * `git` in order to get PostgreSQL trunk version.\n\n\nTODO\n----\n\nSee the [issue list of enhancements](https://github.com/guedes/pgvm/issues?labels=enhancement\u0026page=1\u0026state=open).\n\n\nOrigins\n-------\n\n`pgvm` was inspired by [rvm](https://rvm.io), a Ruby enVironment Manager created by [Wayne E. Seguin](http://wayneseguin.us).\n\n\nCopyright and License\n---------------------\n\nCopyright (c) 2012,2013 Dickson S. Guedes.\n\nThis module is free software; you can redistribute it and/or modify it under\nthe [PostgreSQL License](http://www.opensource.org/licenses/postgresql).\n\nPermission to use, copy, modify, and distribute this software and its\ndocumentation for any purpose, without fee, and without a written agreement is\nhereby granted, provided that the above copyright notice and this paragraph\nand the following two paragraphs appear in all copies.\n\nIn no event shall Dickson S. Guedes be liable to any party for direct,\nindirect, special, incidental, or consequential damages, including lost\nprofits, arising out of the use of this software and its documentation, even\nif Dickson S. Guedes has been advised of the possibility of such damage.\n\nDickson S. Guedes specifically disclaims any warranties, including, but not\nlimited to, the implied warranties of merchantability and fitness for a\nparticular purpose. The software provided hereunder is on an \"as is\" basis,\nand Dickson S. Guedes has no obligations to provide maintenance, support,\nupdates, enhancements, or modifications.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguedes%2Fpgvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguedes%2Fpgvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguedes%2Fpgvm/lists"}