SHOW CATALOGS

Preview

Unity Catalog is in Public Preview. To participate in the preview, contact your Databricks representative.

Lists the catalogs that match an optionally supplied regular expression pattern. If no pattern is supplied then the command lists all catalogs in the metastore.

Since: Databricks Runtime 10.3

Syntax

SHOW CATALOGS [ LIKE regex_pattern ]

Parameters

  • regex_pattern

    A regular expression pattern that is used to filter the results of the statement. - Except for * and | character, the pattern works like a regular expression. - * alone matches 0 or more characters and | is used to separate multiple different regular expressions, any of which can match. - The leading and trailing blanks are trimmed in the input pattern before processing. The pattern match is case-insensitive.

Examples

-- Create catalogs.
> CREATE CATALOG payroll_cat;
> CREATE CATALOG payments_cat;

-- Lists all the databases.
> SHOW CATALOGS;
 catalog
 --------------
 hive_metastore
           main
   payments_cat
    payroll_cat

-- Lists databases with name starting with string pattern `pay`
> SHOW CATALOG LIKE 'pay*';
 catalog
 ------------
 payments_cat
  payroll_cat