relations
Description
Exposes metadata about all relations (streams, changelogs, tables, materialized views, and indexes) in the organization. This is the programmatic equivalent of LIST RELATIONS. Only relations on which the current role has SELECT or INSERT privileges are returned.
Syntax
SELECT * FROM deltastream.sys."relations";Columns
name
VARCHAR
No
Name of the relation.
schema_name
VARCHAR
No
Schema (namespace) containing the relation.
database_name
VARCHAR
No
Database containing the relation.
fqn
VARCHAR
No
Fully qualified name of the relation, e.g. mydb.public.my_stream.
store_name
VARCHAR
Yes
Name of the backing store, if any.
relation_type
VARCHAR
No
Type of the relation. One of stream, changelog, table, materialized_view, index.
primary_key
VARCHAR
Yes
Primary key column(s) for changelogs and tables, if defined.
partition_keys
VARCHAR
Yes
Partition key column(s), if defined.
state
VARCHAR
No
Current state of the relation. One of created, errored.
error_messages
VARCHAR
Yes
Error messages if state is errored.
properties
VARCHAR
No
JSON object of relation-specific properties (e.g. store topic, value format).
description
VARCHAR
Yes
Optional description of the relation.
owner
VARCHAR
No
The role that owns this resource.
created_by_role
VARCHAR
No
The role that created this resource.
created_by_role_deleted
BOOLEAN
No
Whether the creating role has since been deleted.
created_by
VARCHAR
No
The user that created this resource.
created_at
TIMESTAMP_LTZ
No
Timestamp when this resource was created.
updated_by_role
VARCHAR
No
The role that last updated this resource.
updated_by_role_deleted
BOOLEAN
No
Whether the last updating role has since been deleted.
updated_by
VARCHAR
No
The user that last updated this resource.
updated_at
TIMESTAMP_LTZ
No
Timestamp when this resource was last updated.
organization_id
VARCHAR
No
The unique identifier of the organization this resource belongs to.
Examples
List all relations:
Filter by relation type:
Filter by database:
See Also
Last updated

