Setup postgres-connect on Windows or Linux
This is a somewhat unsupported method of running postgres-connect, since the bulk of users of postgres-connect are on Macbooks. However, since the postgres-connect app itself is written in Go, cross-platform usage isn’t too much of an issue, and the below procedure has been proven to work.
For Windows, before starting you must install WSL or a Linux virtual machine. These directions are assuming you are in a Linux environment, but they could probably be modified to work in native Windows.
If you have issues, you can ask one of the kind souls in #sig-unix, or if it is truly an issue in postgres-connect itself, try the postgres-connect slack channel.
Step 1: Install Banno CA Certificates
Add the banno certs to the system certificate store and trust em:
- Download and untar: https://banno-tooling.s3.amazonaws.com/certs/banno-ca-certs-2023-01-17.tar.gz
- rename all ‘
*.pem’ files to ‘*.crt’ - [sudo] copy them to /usr/local/share/ca-certificates
- run ‘
[sudo] update-ca-certificates’
(Ref: homebrew-tap script )
Step 2: Get postgres-connect for linux
- Go to the artifactory repository for postgres-connect
- Download the most up to date version for your architecture (for Linux it’s probably something like “
postgres-connect-v1.6.8-linux-amd64.tar.gz” - Untar that file and copy the “
postgres-connect” binary somewhere in your path (like"/usr/local/bin/"). Make sure it is executable as well (ie."chmod 755 postgres-connect").
Aside: How to build postgres-connect for linux
This could be useful info in case the build you want isn’t available in the normal spot (above).
- Get the repo: ‘
git clone git@github.com:Banno/postgres-connect.git’ - Checkout the latest tagged version (’
git checkout $TAG’) - Install golang (on Ubuntu/Debian, ‘
apt-get install golang’) - Build using ‘
make build’- The output file is in the main directory, a file called ‘
postgres-connect’.
- The output file is in the main directory, a file called ‘
- Copy it to somewhere in your path (ie., ‘
cp -a postgres-connect /usr/local/bin/’)
Step 3: Install ‘psql’
On Ubuntu/Debian, it would be: ‘apt-get install postgresql-client’.
Step 4: Test It
Try this command, or some command that works for your level of permissions:
.build/linux/amd64/postgres-connect connect --name=pg-banno --role=team-aviato --database=banno_all --env=stage
Pager usage is off.
AUTOCOMMIT is on
psql (15.6 (Debian 15.6-0+deb12u1))
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off)
Type "help" for help.
banno_all=> select count(*) from transfer_accounts;
count
-------
22977
(1 row)