SQL reference

Metadata and introspection

SHOW, DESCRIBE, information_schema and result-column contracts.

Metadata respects workspace permissions. A row is visible only when the current principal can discover the corresponding object.

SHOW and DESCRIBE

StatementPurpose
SHOW DATABASESList attached catalogs/databases visible to the session.
SHOW SCHEMASList schemas in the selected catalog.
SHOW TABLESList tables in the current schema.
SHOW ALL TABLESList visible tables across attached namespaces.
SHOW SECRETSReturn redacted secret metadata; never returns credential values.
DESCRIBE table_nameReturn bound column names, types, nullability and available defaults.
DESCRIBE SELECT ...Return the result schema without consuming the result rows.
SUMMARIZE table_or_queryReturn bounded descriptive statistics by column.
USE lakehouse.sales;
SHOW TABLES;
DESCRIBE orders;
DESCRIBE SELECT customer_id, sum(net_amount) AS revenue FROM orders GROUP BY 1;

Information Schema

Use information_schema for portable catalog discovery.

ViewImportant columns
information_schema.schematacatalog_name, schema_name, ownership metadata where exposed
information_schema.tablescatalog, schema, table name and table type
information_schema.columnsordinal, name, nullable flag, data type and declared numeric/text attributes
information_schema.viewsview identity and visible definition metadata
information_schema.table_constraintsconstraint name and type
information_schema.key_column_usageconstrained column ordinals
information_schema.referential_constraintsvisible foreign-key relationships
information_schema.routinesfunction name, kind, parameters and return type available to the warehouse
information_schema.parametersroutine parameter order, mode and data type
SELECT table_schema, table_name
FROM information_schema.tables
WHERE table_type = 'BASE TABLE'
ORDER BY table_schema, table_name;
SELECT routine_schema, routine_name, data_type
FROM information_schema.routines
WHERE lower(routine_name) = 'array_cosine_similarity';

Query inspection

EXPLAIN SELECT ...;
EXPLAIN ANALYZE SELECT ...;

EXPLAIN returns the admitted physical plan, including distributed stages and data exchanges. EXPLAIN ANALYZE executes the query and adds observed metrics. It is not a dry run and can consume the same data and compute as the underlying statement.

Plans are diagnostic output, not a stable API. Automation should use query-history fields rather than parsing formatted plan text.

Result schemas

Applications should obtain result-column metadata through the PostgreSQL driver after prepare/describe. Names and types are fixed before execution. Dynamic-schema constructs such as PIVOT must resolve a bounded output schema during planning before the client receives row data.

Nested values whose PostgreSQL protocol has no native representation are returned as canonical JSONB. Cast explicitly when a client requires a stable scalar representation.

Visibility and consistency

Metadata queries observe the catalog snapshot established for the statement or transaction. After an administrator changes a catalog registration, reconnect or reattach it before assuming that an existing session has refreshed registration metadata.

Vegalake, VegaDB and VegaFlow are trademarks or registered trademarks of Vegalake Inc.

On this page