{"id":20643851,"url":"https://github.com/adjust/pgbundle","last_synced_at":"2026-03-27T04:09:01.934Z","repository":{"id":56887892,"uuid":"19896888","full_name":"adjust/pgbundle","owner":"adjust","description":"bundling postgres extension","archived":false,"fork":false,"pushed_at":"2025-03-14T16:42:26.000Z","size":59,"stargazers_count":38,"open_issues_count":4,"forks_count":3,"subscribers_count":68,"default_branch":"master","last_synced_at":"2025-10-19T13:09:59.412Z","etag":null,"topics":["adjust-kpis-team"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adjust.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-05-17T21:37:26.000Z","updated_at":"2025-04-23T16:49:49.000Z","dependencies_parsed_at":"2025-04-16T02:06:52.501Z","dependency_job_id":"685cee09-9bec-4b35-b538-82c76e32168a","html_url":"https://github.com/adjust/pgbundle","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/adjust/pgbundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adjust%2Fpgbundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adjust%2Fpgbundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adjust%2Fpgbundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adjust%2Fpgbundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adjust","download_url":"https://codeload.github.com/adjust/pgbundle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adjust%2Fpgbundle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31018555,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-27T03:51:26.850Z","status":"ssl_error","status_checked_at":"2026-03-27T03:51:09.693Z","response_time":164,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["adjust-kpis-team"],"created_at":"2024-11-16T16:14:02.270Z","updated_at":"2026-03-27T04:09:01.917Z","avatar_url":"https://github.com/adjust.png","language":"Ruby","readme":"[![Build Status](https://travis-ci.org/adjust/pgbundle.svg?branch=master)](https://travis-ci.org/adjust/pgbundle)\n\n# pgbundle\n\nbundling postgres extension\n\n## install\n\n  gem install pgbundle\n\n## usage\n\ndefine your dependent postgres extensions in a Pgfile like this:\n\n```\n# Pgfile\n\ndatabase 'my_database', host: 'my.db.server', use_sudo: true, system_user: 'postgres'\n\npgx 'hstore'\npgx 'my_extension', '1.0.2', github: me/my_extension\npgx 'my_other_extionsion', :git =\u003e 'https://github.com/me/my_other_extionsion.git'\npgx 'my_ltree_dependend_extension', github: me/my_ltree_dependend_extension, requires: 'ltree'\n```\n\n**database**\n\n`database` defines on which database(s) the extensions should be installed. The first\nargument is the database name the additional options may specify your setup but\ncome with reasonable default values.\n\noption        | default     | desciption\n-------       | -------     | -----------\nuser          | 'postgres'  | the database user (needs privilege to `CREATE EXTENSION`)\nhost          | 'localhost' | the database host (needs to be accessible from where `pgbundle` runs)\nuse_sudo      | false       | if true use `sudo` to run `make install` if needed\nsystem_user   | 'postgres'  | the (os) system user that is allowed to install an extension (through make)\nport          | 5432        | the database port\nforce_ssh     | false       | run commands via ssh even if host is `localhost`\nslave         | false       | defines if the database runs as a read-only slave thus skips any `CREATE` command\n\n**pgx**\n\nThe `pgx` command defines you actual Extension. The first argument specifies the Extension name,\nthe second optional parameter defines the required Version. If the Extension is not yet\ninstalled on the server you may wish to define how `pgbundle` can find it's source to build\nand install it. And which Extensions may be required\n\noption      | description\n------      | -----------\ngit         | any git repository pgbundle can clone from\ngithub      | any github repository in the form `user/repository`\nbranch      | an optional branch name for git or github sources defaults to `master`\nrequires    | an optional extension that the extension depends on\npath        | any absolute or relative local path e.g. './foo/bar'\npgxn        | any repository available on http://pgxn.org/\nflags       | optional string used for make results in \"make flags \u0026\u0026 make flags install\"\n\n\nSome Extensions may require other Extensions to allow `pgbundle` to resolve dependencies\nand install it in the right order you can define them with `requires`.\nIf the required Extension is not yet available on the target server or the Extension\nrequires a specific Version you should define it as well.\nE.g.\n\n```\n# Pgfile\n\ndatabase ...\n\npgx 'foo', '0.1.2', github: me/foo\n\n# set foo as dependency for bar\npgx 'bar', '1.2.3', github: me/bar, requires: 'foo'\n\n# set bar and boo as dependency for baz\n# will automatically set foo as dependency as well\npgx 'baz', '0.2.3', github: me/baz, requires: ['bar', 'boo']\n# installs jsquery with flag 'USE_PGXS=1'\n# i.e. running make USE_PGXS=1 \u0026\u0026 make USE_PGXS=1 install\npgx 'jsquery', github: 'postgrespro/jsquery', flags: 'USE_PGXS=1'\n```\n\n## pgbundle commands\n\n`pgbundle` comes with four commands. If the optional `pgfile` is not given it assumes\nto find a file named `Pgfile` in the current directory.\n\n**check**\n\nchecks availability of required extensions.\n\n```\npgbundle check [pgfile]\n```\n\n`check` does not change anything on your system, it only checks which\nof your specified extensions are available and which are missing.\nIt returns with exitcode `1` if any Extension is missing and `0` otherwise.\n\n\n**install**\n\ninstalls extensions\n\n```\npgbundle install [pgfile] [-f]\n```\n\n`install` tries to install missing Extensions. If `--force` is given it installs\nall Extension even if they are already installed.\n\n**create**\n\ncreate the extension at the desired version\n\n```\npgbundle create [pgfile]\n```\n\n`create` runs the `CREATE EXTENSION` command on the specified databases. If a version\nis specified in the `Pgfile` it tries to install with `CREATE EXTENSION VERSION version`.\nIf the Extension is already created but with a wrong version, it will run\n`ALTER EXTENSION extension_name UPDATE TO new_version`.\n\n**init**\n\nwrite an initial pgfile to stdout\n\n```\npgbundle init db_name -u user -h host -p port\n```\n\n`init` is there to help you get started. If you have already a database with installed\nExtensions you get the content for an initial `Pgfile`. Pgbundle will figure out\nwhich Extension at which Version are already in use and print a reasonable starting\npoint for you Pgfile.\nHowever this is only to help you get started you may wish to specify sources and\ndependencies correctly.\n\n### How it works\n\nYou may already have noticed that using Extensions on postgres requires two different\nsteps. Building the extension on the database cluster with `make install`\nand creating the extension into the database with `CREATE/ALTER EXTENSION`.\nPgbundle reflects that with the two different commands `install` and `create`.\n\nUsually `pgbundle` runs along with your application on your application server\nwhich often is different from your database machine. Thus the `install` step\nwill (if necessary) try to download the source code of the extension into a\ntemporary folder and then copy it to your database servers into `/tmp/pgbundle`.\nFrom there it will run `make clean \u0026\u0026 make \u0026\u0026 make install` for each database.\nYou may specify as which user you want these commands to run with the `system_user`\noption. Although for security reasons not recommended you can specify to run the\ninstall step with sudo `use_sudo: true`, but we suggest to give write permission\nfor the postgres system user to the install targets. If you are not sure which these\nare run\n\n```\npg_config\n```\n\nand find the `LIBDIR`, `SHAREDIR` and `DOCDIR`\n\n#### master - slave\n\nEvery serious production database cluster usually has a slave often ran as Hot Standby.\nYou should make sure that all your Extension are also installed on all slaves.\nBecause database slaves run as read-only servers any attempt to `CREATE` or `ALTER`\nExtension will fail, these commands should only run on the master server and will\nbe replicated to the slave from there. You can tell `pgbundle` that it should skip\nthese steps with `slave: true`.\n\n\n","funding_links":[],"categories":["Uncategorized","Ruby","Compiled list"],"sub_categories":["Uncategorized","plv8:"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadjust%2Fpgbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadjust%2Fpgbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadjust%2Fpgbundle/lists"}