Skip to main content

postgres_snapshots

Creates, updates, deletes, gets or lists a postgres_snapshots resource.

Overview

Namepostgres_snapshots
TypeResource
Iddatabricks_workspace.postgres.postgres_snapshots

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe resource name of the snapshot. Format: projects/{project_id}/snapshots/{snapshot_id}
snapshot_idstringThe user-chosen ID; the final segment of ``name``.
create_timestring (date-time)When the snapshot was created.
specobjectClient-provided configuration of the snapshot.
statusobjectServer-observed state of the snapshot.
uidstringUnique system-generated ID for the snapshot.
update_timestring (date-time)When the snapshot was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectparent, deployment_namepage_size, page_tokenReturns a paginated list of snapshots in the project.
createinsertparent, deployment_name, snapshotsnapshot_idCreates a snapshot, an immutable point-in-time copy of a branch's data, within the project.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)
parentstringThe project in which to create the snapshot. Format: projects/{project_id}
page_sizeintegerMaximum number of snapshots to return per page.
page_tokenstringPage token from a previous response; omit for the first page.
snapshot_idstringClient-chosen ID for the snapshot. If omitted, the server generates one.

SELECT examples

Returns a paginated list of snapshots in the project.

SELECT
name,
snapshot_id,
create_time,
spec,
status,
uid,
update_time
FROM databricks_workspace.postgres.postgres_snapshots
WHERE parent = '{{ parent }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND page_size = '{{ page_size }}'
AND page_token = '{{ page_token }}'
;

INSERT examples

Creates a snapshot, an immutable point-in-time copy of a branch's data, within the project.

INSERT INTO databricks_workspace.postgres.postgres_snapshots (
snapshot,
parent,
deployment_name,
snapshot_id
)
SELECT
'{{ snapshot }}' /* required */,
'{{ parent }}',
'{{ deployment_name }}',
'{{ snapshot_id }}'
;