Skip to content

becomeliminal/postgres

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PostgreSQL Binaries

This repo provides build rules to compile PostgreSQL binaries from source for the Please build system.

Additionally, pre-built PostgreSQL Binary artifacts are available for download from the GitHub release assets.

Pre-Built Binaries: Supported Versions

PostgreSQL Version Supported OS Supported Architecture Download Link
18.0 Linux x86_64 Download
17.6 Linux x86_64 Download
17.5 Linux x86_64 Download
17.4 Linux x86_64 Download
17.3 Linux x86_64 Download
17.2 Linux x86_64 Download
17.1 Linux x86_64 Download
17.0 Linux x86_64 Download
16.10 Linux x86_64 Download
16.9 Linux x86_64 Download
16.8 Linux x86_64 Download
16.7 Linux x86_64 Download
16.6 Linux x86_64 Download
16.5 Linux x86_64 Download
16.4 Linux x86_64 Download
16.3 Linux x86_64 Download
16.2 Linux x86_64 Download
16.1 Linux x86_64 Download
16.0 Linux x86_64 Download
15.14 Linux x86_64 Download
14.19 Linux x86_64 Download
13.22 Linux x86_64 Download

Basic Usage

Option 1: Use as a Please Plugin

  1. Add the plugin to your project

    In plugins/BUILD:

    plugin_repo(
        name = "postgres",
        owner = "jackmarsh",
        revision = "v0.0.3",
    )
  2. Update your .plzconfig

    Add the following section:

    [Plugin "postgres"]
    Target = //plugins:postgres
  3. Use the PostgreSQL build rules in your project

    After setting up the plugin, you can use the postgres build rule to include PostgreSQL binaries in your project. Example:

    subinclude("///postgres//build_defs:postgres")
    
    postgres(
        name = "psql",
        version = "18.0",
        visibility = ["PUBLIC"],
    )

    This will build the specified version of PostgreSQL binaries from source.

Configuring Custom Build Flags

The postgres build definition allows you to customize the build process by passing flags to the configure script. This is useful if you need to enable or disable specific PostgreSQL features or specify custom installation paths.

Example

You can pass configure_flags to the build rule like this:

postgres(
    name = "psql",
    version = "18.0",
    configure_flags = ["--enable-debug", "--with-openssl"],
    visibility = ["PUBLIC"],
)

Make sure to pass the flags as a list in the format: ["--key", "value", "--key", "value"].

For a detailed explanation of the available configuration options, see the PostgreSQL Documentation on Configure Options.


Required Tools and Libraries

Building PostgreSQL from source requires the following tools and libraries to be installed on your system:

Required Tools:

  • gcc
  • make
  • automake
  • autoconf
  • flex
  • bison
  • perl
  • pkg-config

Required Libraries:

  • libicu-dev
  • libreadline-dev

Installing Dependencies with Please

You can use the provided setup target to install the required tools and libraries into your environment:

plz run ///postgres//:setup

This will ensure all dependencies are available in the path, allowing the postgres binary to compile from source successfully.


Option 2: Use Pre-built Binaries (Recommended for RBE)

If you prefer not to build PostgreSQL from source, use the postgres_binary rule to download pre-built binaries. This is much faster, especially for Remote Build Execution (RBE) where workers just download ~10MB instead of compiling for 5-10 minutes.

subinclude("///postgres//build_defs:postgres")

postgres_binary(
    name = "postgres",
    version = "17.2",
    visibility = ["PUBLIC"],
)

The postgres_binary rule provides the same output structure as postgres (bin, lib, include, share), so it's a drop-in replacement.

Manual Download

Alternatively, you can directly download pre-built binaries from the GitHub release assets:

remote_file(
    name = "psql",
    url = "https://github.com/jackmarsh/postgres/releases/download/v0.0.3/psql-18.0-linux_x86_64.tar.gz",
    hashes = ["<hash of the file>"], # Optional
)

You can find pre-built binaries for supported OS and architecture combinations in the release page.


Notes

You may need to pass the -L /path/to/psql/share flag to initdb.


Releases

You can find all available versions and corresponding binaries on the releases page.


Need Additional Pre-Built Binaries?

If you need a pre-built binary for a specific PostgreSQL version, operating system, or architecture that is not currently included in the release assets, feel free to reach out or open an issue.

We're happy to consider adding additional prebuilt binaries to future releases!

About

Tool for building PostgreSQL binaries from source via Please

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •