Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add full compilation instructions for Ubuntu 24.04 #488

Merged
merged 2 commits into from
Dec 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 67 additions & 3 deletions docs/compilation.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,71 @@ Next, create the `pg_duckdb` extension:
CREATE EXTENSION pg_duckdb;
```

TODO: List instructions to build 'from scratch', including all required dependencies with a `brew`/`apt install`, on at least:
# Ubuntu 24.04

* Ubuntu 24.04
* MacOS
This example uses Postgres 17. If you wish to use another version, substitute the version number in the commands as necessary.

### Set up Postgres

We recommend using PGDG for Postgres, but you are welcome to use any Postgres packages or install from source. To install Postgres 17 from PGDG:

```sh
sudo apt install postgresql-common
sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh
sudo apt install postgresql-17 postgresql-server-dev-17
```

If you do not install from PGDG, please note that you must have the `dev` package installed to compile extensions.

### Install Build Dependencies

```sh
sudo apt install \
build-essential libreadline-dev zlib1g-dev flex bison libxml2-dev \
libxslt-dev libssl-dev libxml2-utils xsltproc pkg-config libc++-dev \
libc++abi-dev libglib2.0-dev libtinfo6 cmake libstdc++-12-dev \
liblz4-dev ninja-build
```

### Clone, Build, and Install pg_duckdb

```sh
git clone https://github.com/duckdb/pg_duckdb
cd pg_duckdb
```

```sh
make -j16
wuputah marked this conversation as resolved.
Show resolved Hide resolved
sudo make install
```

### Add pg_duckdb to shared_preload_libraries

```sh
sudo -s
echo "shared_preload_libraries = 'pg_duckdb'" >/etc/postgresql/17/main/conf.d/pg_duckdb.conf
exit
wuputah marked this conversation as resolved.
Show resolved Hide resolved
```

Alternatively, you can directly edit `/etc/postgresql/17/main/postgresql.conf` if desired.

### Restart Postgres

```sh
sudo service postgresql restart
```

### Connect and Activate

You may wish to now create databases and users as desired. To use pg_duckdb immediately, you can use
the `postgres` superuser to connect to the default `postgres` database:

```console
$ sudo -u postgres psql

postgres=# CREATE EXTENSION pg_duckdb;
```

# MacOS

TODO