CREATE CATALOG#

Synopsis#

[ SHOW ]
CREATE CATALOG
catalog_name
USING connector_name
[ WITH ( property_name = expression [, ...] ) ]

Description#

Create a new catalog using the specified connector.

Note

The CREATE CATALOG SQL statement is available as a public preview in Starburst Enterprise. Contact Starburst Support with questions or feedback.

The optional WITH clause is used to set properties on the newly created catalog. Property names can be double quoted, which is required if they contain special characters, like -. Refer to the connectors documentation to learn about all available properties. All property values must be varchars (single quoted), including numbers and boolean values.

The query fails in the following circumstances:

  • A required property is missing.

  • An invalid property is set, for example there is a typo in the property name, or a property name from a different connector was used.

  • The value of the property is invalid, for example a numeric value is out of range, or a string value doesn’t match the required pattern.

  • The value references an environmental variable that is not set on the coordinator node.

  • When catalogs configurations are stored in the Backend service database using catalog.store=starburst, security-sensitive property values cannot contain any plaintext. They must be passed with secrets management.

Note

This command requires the catalog management type to be set to dynamic.

The complete CREATE CATALOG query is logged and visible in the Starburst Enterprise web UI, but security-sensitive configuration properties are masked.

The statement SHOW CREATE CATALOG can be run to show the full schema pattern and variables used to create the catalog. This statement can only be run on catalogs created using CREATE CATALOG statements, and is subject to access control checks to ensure the current user has appropriate permissions.

Examples#

Create a new catalog called tpch using the TPC-H connector:

CREATE CATALOG tpch USING tpch;

Create a new catalog called brain using the Memory connector:

CREATE CATALOG brain USING memory
WITH ("memory.max-data-per-node" = '128MB');

Notice that the connector property contains dashes (-) and needs to quoted using a double quote ("). The value 128MB is quoted using single quotes, because it is a string literal.

Create a new catalog called example using the PostgreSQL connector:

CREATE CATALOG example USING postgresql
WITH (
  "connection-url" = 'jdbc:pg:localhost:5432',
  "connection-user" = '${ENV:POSTGRES_USER}',
  "connection-password" = '${ENV:POSTGRES_PASSWORD}',
  "case-insensitive-name-matching" = 'true'
);

This example assumes that the POSTGRES_USER and POSTGRES_PASSWORD environmental variables are set as secrets on all nodes of the cluster.

Create a new catalog called example_2 that uses the configuration of catalog example as described above, specifying its own credentials and adding one additional property configuration:

CREATE CATALOG example_2 USING postgresql
LIKE example
WITH (
  "connection-user" = '${ENV:POSTGRES_USER_TWO}',
  "connection-password" = '${ENV:POSTGRES_PASSWORD_TWO}',
  "dynamic-filtering.wait-timeout" = '30s'
);

View the full statement used to create the catalog `example` as described above:

```sql
SHOW CREATE CATALOG example

See also#