Skip to content

Install and update pgwire

This page explains where the KDB-X installer puts pgwire, and how to install or update it yourself from the KX downloads portal.

pgwire is a single executable, pg (pg.exe on Windows). It connects PostgreSQL clients to a q process that has loaded the SQL interface.

Installed by default

The KDB-X installer downloads the latest pgwire release and places pg in bin/ in your installation directory, which defaults to $HOME/.kx. That folder is already on your PATH, so you can run pg from any directory. You do not need to install it separately after a standard installation.

Linux ARM

pgwire is not available for Linux ARM (aarch64), so the installer skips it on that platform.

Install or update manually

Install manually when you want a newer pgwire release than the one your installer shipped.

Before you begin

  • Know your KDB-X installation directory, if you are updating an existing installation. The default is $HOME/.kx. The commands below use that path. If you installed KDB-X elsewhere, replace it with your installation directory.

1. Download the archive

Download the archive for your platform from the SQL directory in the KX downloads portal. pgwire ships in the same archive as the SQL interface. The ~latest~ path always points at the newest release. Each archive contains pg, s.k_, a readme and a changelog.

Archive Platform Executable
l64-sql.zip Linux x86-64 pg
m64-sql.zip macOS (Intel and Apple Silicon) pg
w64-sql.zip Windows pg.exe
curl -L -O https://portal.dl.kx.com/assets/raw/kdb-x/sql/~latest~/l64-sql.zip
curl -L -O https://portal.dl.kx.com/assets/raw/kdb-x/sql/~latest~/m64-sql.zip

Download w64-sql.zip in your browser.

To install a specific version instead, replace ~latest~ with the version number, for example 1.2.3.

2. Extract and copy the executable

Extract the archive, then copy pg into bin/ in your installation directory. Copying over the existing file updates it.

unzip -q l64-sql.zip -d sql
cp sql/pg "$HOME/.kx/bin/"
chmod +x "$HOME/.kx/bin/pg"
unzip -q m64-sql.zip -d sql
cp sql/pg "$HOME/.kx/bin/"
chmod +x "$HOME/.kx/bin/pg"

Extract the archive and run pg.exe from the extracted folder, or copy it to a folder on your PATH.

The same archive contains the SQL interface. To update it at the same time, follow Install and update SQL.

3. Verify the installation

Run pg with no arguments. It prints its version and usage:

$ pg
pg 2026.10.20 (c api 20201125) Copyright (C) 1993-2026 Kx Systems
Usage: pg [-T kdb_timeout][-I interface][-v] listen_port kdb_host kdb_port

Next steps