Skip to content

Commit 550d926

Browse files
authored
feat: Add support for the PostgreSQL connector (#883)
* feat: Add support for the PostgreSQL connector * changelog * Use to_uppercase * typo
1 parent 8b6085d commit 550d926

26 files changed

Lines changed: 246 additions & 90 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
### Added
8+
9+
- Added support for the [PostgreSQL connector](https://trino.io/docs/current/connector/postgresql.html) using the new generic database connection mechanism.
10+
Previously, users had to use the `generic` connector ([#883]).
11+
712
### Changed
813

914
- BREAKING: `configOverrides` now only accepts the supported config file names
@@ -26,6 +31,7 @@ All notable changes to this project will be documented in this file.
2631
[#869]: https://github.com/stackabletech/trino-operator/pull/869
2732
[#876]: https://github.com/stackabletech/trino-operator/pull/876
2833
[#878]: https://github.com/stackabletech/trino-operator/pull/878
34+
[#883]: https://github.com/stackabletech/trino-operator/pull/883
2935

3036
## [26.3.0] - 2026-03-16
3137

Cargo.nix

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crate-hashes.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/modules/trino/pages/usage-guide/catalogs/black-hole.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Primarily the https://trino.io/docs/current/connector/blackhole.html[Black Hole
44
It works like the `/dev/null` device on Unix-like operating systems for data writing and like `/dev/null` or `/dev/zero` for data reading.
55

66
== Example Black Hole catalog configuration
7+
78
[source,yaml]
89
----
910
apiVersion: trino.stackable.tech/v1alpha1

docs/modules/trino/pages/usage-guide/catalogs/delta-lake.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@ spec:
3030
----
3131

3232
== Connect to S3 store or HDFS
33+
3334
The Delta Lake connector connects to S3 or HDFS in the same way the xref:usage-guide/catalogs/hive.adoc[] connector does.
3435
Refer to that documentation for access configuration.

docs/modules/trino/pages/usage-guide/catalogs/generic.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ In case the Stackable operator for Trino does not support a specific connector y
88
This is how you can e.g. use the {trino-psql-connector}[PostgreSQL connector]:
99

1010
== Example generic catalog properties
11+
1112
[source,yaml]
1213
----
1314
apiVersion: trino.stackable.tech/v1alpha1

docs/modules/trino/pages/usage-guide/catalogs/google-sheets.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ It needs a service-user to access the Google APIs.
66
Consult the {trino-google-sheets-connector}[official documentation] on how to use the Google Sheets connector.
77

88
== Example Google sheets catalog configuration
9+
910
[source,yaml]
1011
----
1112
apiVersion: trino.stackable.tech/v1alpha1

docs/modules/trino/pages/usage-guide/catalogs/hive.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ The Apache Hive connector allows Trino to connect to a Hive metastore and query
55
Deploy a Hive Stacklet with the xref:hive:index.adoc[].
66

77
== Example Hive catalog configuration
8+
89
[source,yaml]
910
----
1011
apiVersion: trino.stackable.tech/v1alpha1
@@ -34,6 +35,7 @@ spec:
3435
<4> Use `configOverrides` to add arbitrary properties to the Trino catalog configuration
3536

3637
== Connect to S3 store
38+
3739
The Hive connector can connect to an S3 store as follows:
3840

3941
[source,yaml]
@@ -58,6 +60,7 @@ See xref:concepts:s3.adoc[] for details about S3 connections.
5860
IMPORTANT: Make sure that the underlying Hive metastore also has access to the S3 store, because it will e.g. check if the directory exists when creating tables.
5961

6062
== Connect to HDFS cluster
63+
6164
The hive connector can connect to an HDFS operated by Stackable as follows:
6265

6366
[source,yaml]
@@ -72,10 +75,12 @@ spec:
7275
IMPORTANT: Make sure that the underlying Hive metastore also has access to the HDFS, because it will e.g. check if the directory exists when creating tables.
7376

7477
== Adding unmanaged Hive clusters
78+
7579
You can add connect Trino to Hive catalogs from systems that are not managed by Stackable, including Hive running on existing Hadoop clusters.
7680
Unmanaged Hive instances can be defined by creating a ConfigMap containing the configuration for the remote Hive Metastore and HDFS or S3 storage services.
7781

7882
=== Create a Hive Metastore configMap
83+
7984
The Hive metastore ConfigMap contains the URL for the metastore's thrift endpoint.
8085
[source,yaml]
8186
----
@@ -88,6 +93,7 @@ data:
8893
----
8994

9095
=== Create a HDFS configMap
96+
9197
When the Hive data is stored on HDFS you will need to provide a ConfigMap containing the HDFS configuration.
9298
To do this take the `core-site.xml` and `hdfs-site.xml` from your Hadoop cluster and create a ConfigMap with the keys `core-site.xml` and `hdfs-site.xml`.
9399

@@ -119,6 +125,7 @@ data:
119125
----
120126

121127
=== Create the Trino Hive catalog
128+
122129
To use the unmanaged Hive metastore we define a TrinoCatalog object in the same way we would for a managed cluster, referencing the custom ConfigMap we created for Hive and HDFS.
123130

124131
[source,yaml]

docs/modules/trino/pages/usage-guide/catalogs/index.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Trino does not have a built-in catalog and instead provides connectors to extern
44
This allows Trino to connect to, read from and join a wide variety of data sources.
55

66
== Using catalogs
7+
78
Catalogs are defined in their own resources and referenced from cluster objects.
89
See the xref:concepts.adoc[] page for more details.
910

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
= PostgreSQL
2+
3+
The https://trino.io/docs/current/connector/postgresql.html[PostgreSQL connector] provides connectivity to a PostgreSQL databases.
4+
5+
== Example PostgreSQL catalog configuration
6+
7+
[source,yaml]
8+
----
9+
apiVersion: trino.stackable.tech/v1alpha1
10+
kind: TrinoCatalog
11+
metadata:
12+
# The name of the catalog as it will appear in Trino
13+
name: postgresql
14+
# TrinoCluster can use these labels to select which catalogs to include
15+
labels:
16+
trino: simple-trino
17+
spec:
18+
connector:
19+
postgresql:
20+
host: my-postgresql
21+
port: 5432 # defaults to 5432
22+
database: mydatabase
23+
credentialsSecretName: my-postgresql-credentials # Must provide the username and password keys
24+
---
25+
apiVersion: v1
26+
kind: Secret
27+
metadata:
28+
name: my-postgresql-credentials
29+
stringData:
30+
username: myusername
31+
password: mypassword
32+
----

0 commit comments

Comments
 (0)