wilton/babelfish-for-postgresql
Project ID: 76242
Description
Babelfish for PostgreSQL RPM packages for EL 7, 8, 9 and Fedora.
EL packages are built against RHEL + EPEL (for EL 8 and 9) and against CentOS + EPEL (for 7), they are expected to be compatible with all popular EL derivatives.
Packages are based on postgresql Fedora package, source tarballs are fetched from GitHub tags ([1], [2]) and from Fedora lookaside cache, spec files and patches are stored on GitHub.
Latest packaged version: Babelfish 3.1 for PostgreSQL 15.2.
Installation Instructions
Install on EL 7 (CentOS example):
$ cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
$ sudo yum install yum-plugin-copr
$ sudo yum copr enable wilton/babelfish-for-postgresql
$ sudo yum update
$ sudo yum install babelfishpg
Install on EL 8, EL 9 or Fedora (Rocky Linux example):
$ cat /etc/redhat-release
Rocky Linux release 8.7 (Green Obsidian)
$ sudo dnf copr enable wilton/babelfish-for-postgresql
$ sudo dnf update
$ sudo dnf install babelfishpg
Create DB and initialize Babelfish:
"postgresql" RPM packages in EL/Fedora use postgresql-setup script to create PostgeSQL DB cluster.
This package includes a modified version of "postgresql-setup" that additionally:
- enables preloading of the Babelfish TDS library
- enables "md5" password auth for localhost TCP connections
- generates self-signed certificate and enables SSL
- creates DB user and a database
- initializes Babelfish extensions in this database using multi-db mode
$ sudo postgresql-setup --initdb --unit postgresql
* Initializing database in '/var/lib/pgsql/data'
* Initialized, logs are in /var/lib/pgsql/initdb_postgresql.log
* Initializing Babelfish extensions
...
* Babelfish initialization complete, use 'systemctl start postgresql' to start the server
* ODBC connection:
* DRIVER={ODBC Driver 18 for SQL Server};SERVER=127.0.0.1,1433;UID=babelfish;PWD=babelfish;TrustServerCertificate=yes
* JDBC connection with mssql-jdbc:
* jdbc:sqlserver://127.0.0.1:1433;encrypt=true;trustServerCertificate=true
WARNING: DB superuser 'babelfish' was created with password 'babelfish', please change the password before allowing remote connections.
Connect to Babelfish:
Connect to DB over TDS port 1433 using mssql-jdbc driver and sqlline command-line SQL client:
$ sudo systemctl start postgresql
$ sudo dnf install java-openjdk
$ curl -LO https://github.com/microsoft/mssql-jdbc/releases/download/v11.2.2/mssql-jdbc-11.2.2.jre8.jar
$ curl -L https://search.maven.org/remotecontent?filepath=sqlline/sqlline/1.12.0/sqlline-1.12.0-jar-with-dependencies.jar -o sqlline-1.12.0-jar-with-dependencies.jar
$ java -cp sqlline-1.12.0-jar-with-dependencies.jar:mssql-jdbc-11.2.2.jre8.jar sqlline.SqlLine --outputformat=vertical
> !connect jdbc:sqlserver://127.0.0.1:1433;encrypt=true;trustServerCertificate=true babelfish babelfish
> select @@version;
version Babelfish for PostgreSQL with SQL Server Compatibility - 12.0.2000.8
May 9 2023 00:00:00
Copyright (c) Amazon Web Services
PostgreSQL 15.2 on x86_64-redhat-linux-gnu (Babelfish 3.1.0)
Active Releases
The following unofficial repositories are provided as-is by owner of this project. Contact the owner directly for bugs or issues (IE: not bugzilla).
Release | Architectures | Repo Download |
---|---|---|
![]() |
x86_64 (316)* | EPEL 7 (14 downloads) |
![]() |
x86_64 (170)* | EPEL 8 (14 downloads) |
![]() |
x86_64 (189)* | EPEL 9 (11 downloads) |
![]() |
x86_64 (336)* | Fedora 36 (0 downloads) |
![]() |
x86_64 (100)* | Fedora 37 (10 downloads) |
![]() |
x86_64 (33)* | Fedora 38 (5 downloads) |
![]() |
x86_64 (110)* | Fedora rawhide (17 downloads) |
* Total number of packages downloaded in the last seven days.