DEBPackages - wiltondb/wiltondb GitHub Wiki

On this page:

WiltonDB packages for Linux are built from exactly the same sources used for Windows MSI installer. These builds in general will behave the same as vanilla Babelfish. Though they may contain patches backported from later versions of Babelfish.

DEB packages are provided for Ubuntu 20.04 and later, they are built on Ubuntu Launchpad service. PPA repository contains packages for LTS versions of Ubuntu, 20.04 and later. These packages are based on postgresql-15 Ubuntu package.

Install WiltonDB on Ubuntu

Enable PPA and install WiltonDB on a clean Ubuntu 20.04 LTS (Focal Fossa):

$ lsb_release -a
[...]
Description:	Ubuntu 20.04.6 LTS
$ sudo apt update
$ sudo apt upgrade
$ sudo apt install software-properties-common
$ sudo add-apt-repository ppa:wiltondb/wiltondb
$ sudo apt update
$ sudo apt install wiltondb
[...]
Need to get 22.2 MB of archives.
After this operation, 122 MB of additional disk space will be used.
[...]
Created symlink /etc/systemd/system/multi-user.target.wants/postgresql.service → /lib/systemd/system
/postgresql.service.
[...]
Setting up wiltondb (3.3-2-4-1~focal) ...

Create DB cluster and initialize WiltonDB

Now we need to create a database cluster and initialize Babelfish extensions there. DEB package includes wiltondb-setup script to do this. wiltondb-setup uses pg_createcluster script from Ubuntu "postgresql-common" package to create the DB cluster and postgresql systemd service. DB cluster files are stored in /var/lib/postgresql/15/main directory and DB configuration files are stored in /etc/postgresql/15/main:

$ sudo wiltondb-setup
Creating new PostgreSQL cluster 15/main ...
/usr/lib/postgresql/15/bin/initdb -D /var/lib/postgresql/15/main --auth-local peer --auth-host scram-sha-256 --no-instructions
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "C.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/15/main ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... US/Alaska
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok
initializing WiltonDB
WARNING: DB superuser 'wilton' was created with password 'wilton', please change the password before allowing remote connections.
initialized, use 'systemctl start postgresql' to start the server

Connect to WiltonDB

Now we can start the postgresql service:

$ sudo systemctl start postgresql
$ sudo systemctl status postgresql
● postgresql.service - PostgreSQL RDBMS
     Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
     Active: active (exited) since Tue 2023-11-07 01:39:48 HST; 2s ago

By default it will listen to TDS connections on port 1433 and to PostgreSQL connections on port 5432.

Lets connect to DB over TDS port 1433 using go-sqlcmd command-line SQL client:

$ curl -LO https://github.com/microsoft/go-sqlcmd/releases/download/v1.4.0/sqlcmd-v1.4.0-linux-amd64.tar.bz2
$ tar xjvf sqlcmd-v1.4.0-linux-amd64.tar.bz2
$ ./sqlcmd -S 127.0.0.1,1433 -U wilton -P wilton
1> select @@version
2> go
version                                                                                                                                                                                                                                                         
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Babelfish for PostgreSQL with SQL Server Compatibility - 12.0.2000.8
Oct 22 2023 17:21:54
Copyright (c) Amazon Web Services
PostgreSQL 15.4 (Ubuntu 1:15.4+wiltondb3.3-2-3~focal) on x86_64-pc-linux-gnu (Babelfish 3.3.0)                                      

(1 row affected)