> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PostgreSQL Wire Protocol

<a id="pwp" />

*Kinetica* has support for *PostgreSQL Wire Protocol* connections.
*PostgreSQL simple query* syntax is fully supported, while
*PostgreSQL extended query* syntax is largely supported.

<a id="pwp-connecting" />

## Connecting

Point any client able to make use of *PostgreSQL Wire Protocol* at *Kinetica*
on port *5432* to connect.

### JDBC

*JDBC* can be used to connect to *PostgreSQL* over *PostgreSQL Wire Protocol*.

```sql title="JDBC Connection String Format" theme={null}
jdbc:postgresql://<db.host>:5432/postgres
```

```sql title="JDBC Connection String Example" theme={null}
jdbc:postgresql://localhost:5432/postgres
```

### PSQL

*PSQL* is a *PostgreSQL* CLI for connecting over *PostgreSQL Wire Protocol*.

```sql title="Connect" theme={null}
psql -h <db.host> -U <username>
```

```sql title="SELECT" theme={null}
=> SELECT * FROM example.vehicle;
```

```sql title="Inspect" theme={null}
 id |  make   |      model
----+---------+------------------
 1  | Cord    | 812
 2  | Bugatti | La Voiture Noire
```

### Psycopg

*Psycopg* is a *Python* library for connecting over *PostgreSQL Wire Protocol*.

```sql title="Connect" theme={null}
>>> import psycopg2
>>> conn = psycopg2.connect(host="<db.host>", user="<username>", password="<password>")
```

```sql title="SELECT" theme={null}
>>> cur = conn.cursor()
>>> cur.execute("SELECT * FROM example.vehicle")
>>> cur.fetchall()
```

```sql title="Inspect" theme={null}
[('1', 'Cord', '812'), ('2', 'Bugatti', 'La Voiture Noire')]
```
