# PostgreSQL

> Trino catalogs for PostgreSQL, covering queries against tables in a PostgreSQL database with credentials taken from a Kubernetes Secret.

The [PostgreSQL connector](https://trino.io/docs/current/connector/postgresql.html) provides connectivity to a PostgreSQL databases.

## Example PostgreSQL catalog configuration

```yaml
apiVersion: trino.stackable.tech/v1alpha2
kind: TrinoCatalog
metadata:
  # The name of the catalog as it will appear in Trino
  name: postgresql
  # TrinoCluster can use these labels to select which catalogs to include
  labels:
    trino: simple-trino
spec:
  connector:
    postgresql:
      host: my-postgresql
      port: 5432 # defaults to 5432
      database: mydatabase
      credentialsSecretName: my-postgresql-credentials # Must provide the username and password keys
---
apiVersion: v1
kind: Secret
metadata:
  name: my-postgresql-credentials
stringData:
  username: myusername
  password: mypassword
```
