Configure a catalog integration for Snowflake Postgres¶
A Snowflake Postgres catalog integration lets Snowflake access Apache Iceberg™ tables that are managed by a Snowflake Postgres instance. When you create a catalog integration for Snowflake Postgres, Snowflake automatically discovers tables in your Postgres databases and makes them available as read-only Iceberg tables.
Snowflake Postgres catalog integrations use vended credentials to access your table data and metadata in cloud storage. You don’t need to configure an external volume or manage storage credentials separately.
Note
Snowflake Postgres catalog integrations are currently supported on AWS only.
Prerequisites¶
A Snowflake account with the Snowflake Postgres feature enabled.
A Postgres instance in READY state. To create a Postgres instance, see CREATE POSTGRES INSTANCE.
The role that creates the catalog integration must have the following privileges:
USAGEon the Postgres instance.CREATE INTEGRATIONon the account.
Considerations¶
Consider the following when you use a Snowflake Postgres catalog integration:
Snowflake Postgres catalog integrations always use vended credentials. You must set
ACCESS_DELEGATION_MODE = VENDED_CREDENTIALS. TheEXTERNAL_VOLUME_CREDENTIALSmode is not supported.You don’t need to specify
REST_AUTHENTICATION. Snowflake handles authentication with the Postgres instance automatically.Auto-refresh uses metadata polling. Change notifications are not supported.
Tables are read-only. Write operations to Postgres-managed Iceberg tables are not supported.
This feature is not supported with burstable Postgres instances.
This feature is supported on AWS only.
Create a catalog integration for Snowflake Postgres¶
To create a catalog integration for Snowflake Postgres, use the CREATE CATALOG INTEGRATION (Snowflake Postgres) command.
For example:
For the full syntax and parameter reference, see CREATE CATALOG INTEGRATION (Snowflake Postgres).
Create an Iceberg table¶
After you create the catalog integration, you can create Iceberg tables that reference tables in your Postgres instance. When you create an Iceberg table with a Snowflake Postgres catalog integration, you specify the catalog integration and the table name as it exists in the Postgres database.
For example:
Where:
CATALOG = '<catalog_integration_name>': Specifies the name of the catalog integration. Required.CATALOG_TABLE_NAME = '<table_name>': Specifies the name of the table as it exists in the Postgres database. Required.CATALOG_NAMESPACE = '<schema_name>': (Optional) Specifies the Postgres schema that contains the table. Defaults to theCATALOG_NAMESPACEvalue set on the catalog integration.CATALOG_NAME = '<database_name>': (Optional) Specifies the Postgres database that contains the table. Defaults to theCATALOG_NAMEvalue set on the catalog integration.AUTO_REFRESH = TRUE: (Optional) Enables automatic metadata refresh. When enabled, Snowflake periodically polls the catalog for metadata changes and refreshes the table automatically.
Note
You don’t need to specify an EXTERNAL_VOLUME when you create an Iceberg table with a
Snowflake Postgres catalog integration.
Create a catalog-linked database¶
Instead of creating individual Iceberg tables, you can create a catalog-linked database that automatically discovers and syncs tables from your Postgres database. A catalog-linked database creates corresponding schemas and Iceberg tables in Snowflake that stay in sync with your Postgres database.
For example:
Where:
CATALOG = <catalog_integration_name>: Specifies the name of the Snowflake Postgres catalog integration. Required. The catalog-linked database syncs the Postgres database specified by theCATALOG_NAMEvalue on the catalog integration.ALLOWED_WRITE_OPERATIONS = NONE: Required for Snowflake Postgres catalog-linked databases. Snowflake Postgres tables are read-only.
After the catalog-linked database is created, Snowflake automatically discovers namespaces and tables from the Postgres database and creates corresponding schemas and Iceberg tables. For more information, see Use a catalog-linked database for Apache Iceberg™ tables.
Query the Iceberg table¶
After you create an Iceberg table or a catalog-linked database, you can query the tables using standard SQL:
Access control¶
The catalog integration owner role must have USAGE on the Postgres instance. Snowflake
checks this privilege when you create the catalog integration.
Any role that has USAGE granted on the catalog integration can create Iceberg tables
that reference tables in the Postgres instance. No additional grants on the Postgres
instance are required. The role also needs the standard Snowflake
privileges to create tables in the target database and schema.
For example, to grant another role the ability to create Iceberg tables using the catalog integration: