Skip to content

vfox/mise plugin for PostgreSQL - compiles from source with dynamic version fetching

License

Notifications You must be signed in to change notification settings

mise-plugins/vfox-postgres

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

vfox-postgres

A vfox / mise plugin for managing PostgreSQL versions.

Features

  • Dynamic version fetching: Automatically fetches available versions from PostgreSQL's official FTP server
  • Always up-to-date: No static version list to maintain
  • Compiles from source: Uses official PostgreSQL source releases
  • Includes contrib modules: Builds and installs useful extensions
  • Automatic initdb: Initializes a database cluster (can be skipped)
  • Cross-platform: Works on Linux and macOS

Requirements

  • A C compiler (gcc or clang)
  • make
  • readline (libreadline-dev on Debian/Ubuntu)
  • zlib (zlib1g-dev on Debian/Ubuntu)
  • OpenSSL (libssl-dev on Debian/Ubuntu)

macOS

xcode-select --install
brew install openssl readline

Debian/Ubuntu

sudo apt-get install build-essential libreadline-dev zlib1g-dev libssl-dev uuid-dev

RHEL/CentOS

sudo yum groupinstall "Development Tools"
sudo yum install readline-devel zlib-devel openssl-devel uuid-devel

Installation

With mise

mise install postgres@latest
mise install [email protected]
mise install [email protected]

With vfox

vfox add postgres
vfox install postgres@latest

Usage

# List all available versions
mise ls-remote postgres

# Install a specific version
mise install [email protected]

# Set global version
mise use -g [email protected]

# Set local version (creates .mise.toml)
mise use [email protected]

Environment Variables

This plugin sets the following environment variables:

  • PATH - Adds the PostgreSQL bin directory
  • PGDATA - Points to the data directory ({install_path}/data)
  • LD_LIBRARY_PATH - Adds PostgreSQL lib directory (Linux only)

Configuration

Skip initdb

If you don't want the plugin to run initdb automatically:

POSTGRES_SKIP_INITDB=1 mise install [email protected]

Custom configure options

Add extra configure options:

POSTGRES_EXTRA_CONFIGURE_OPTIONS="--with-python" mise install [email protected]

Or override all configure options (prefix is always added):

POSTGRES_CONFIGURE_OPTIONS="--with-openssl --with-python" mise install [email protected]

Starting PostgreSQL

After installation:

# Start the server
pg_ctl -D $PGDATA -l logfile start

# Or run in foreground
postgres -D $PGDATA

# Connect
psql -U postgres

How It Works

This plugin:

  1. Fetches the list of available versions from ftp.postgresql.org
  2. Downloads the source tarball for the requested version
  3. Compiles PostgreSQL with ./configure && make && make install
  4. Builds and installs contrib modules
  5. Runs initdb to create an initial database cluster

License

MIT License - see LICENSE for details.

About

vfox/mise plugin for PostgreSQL - compiles from source with dynamic version fetching

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages