10.13. Starburst PostgreSQL Connector#

The Starburst PostgreSQL Connector is an extended version of the PostgreSQL Connector with configuration and usage identical.

The following improvements are included:

Kerberos Authentication#

The PostgreSQL connector supports Kerberos-based authentication with the following configuration:

postgresql.authentication.type=KERBEROS
kerberos.client.principal=example@example.com
kerberos.client.keytab=etc/kerberos/example.keytab
kerberos.config=etc/kerberos/krb5.conf

With this configuration the user example@example.com, defined in the principal property, is used to connect to the database, and the related Kerberos service ticket is located in the example.keytab file.

Kerberos Credential Passthrough#

The PostgreSQL connector can be configured to pass through Kerberos credentials, received by Presto, to the PostgreSQL database.

Configure Kerberos and Presto, following the instructions in Kerberos Credential Passthrough.

Then configure the connector to pass through the credentials from the server to the database in your catalog properties file and ensure the Kerberos client configuration properties are in place on all nodes.

postgresql.authentication.type=KERBEROS_PASS_THROUGH
http.authentication.krb5.config=/etc/krb5.conf
http-server.authentication.krb5.service-name=exampleServiceName
http-server.authentication.krb5.keytab=/path/to/Keytab/File

Now any database access via Presto is subject to the data access restrictions and permissions of the user supplied via Kerberos.

User Impersonation#

The PostgreSQL connector supports user impersonation.

User impersonation can be enabled in the catalog file:

postgresql.impersonation.enabled=true

User impersonation in PostgreSQL connector is based on SET ROLE. For more details visit: www.postgresql.org/docs.

Table Statistics#

PostgreSQL connector supports table and column statistics, as documented in Table Statistics. The statistics are collected by PostgreSQL and retrieved by the connector. To collect statistics for a table, execute the following statement in PostgreSQL.

ANALYZE table_schema.table_name;

Refer to PostgreSQL documentation for additional ANALYZE options.

The table and column statistics can be viewed in Presto using SHOW STATS and are used for Cost based optimizations.

Table Statistics Configuration Properties#

Property Name

Description

Default

statistics.enabled

Enables table and column statistics.

true

statistics.cache-ttl

Duration for which table and column statistics are cached.

0s

statistics.cache-missing

Cache the fact that table statistics are not available.

false