Skip to main content

postgres_tables

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

Overview

Namepostgres_tables
TypeResource
Iddatabricks_workspace.postgres.postgres_tables

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringFull three-part (catalog, schema, table) name of the table.
branchstringThe id of the database branch associated with the table. Of the format projects/{project_id}/branches/{branch_id}.
databasestringThe project and branch scoped database to which this table belongs. Of the format: projects/{project_id}/branches/{branch_id}/databases/{database_id} where database_id is the name of the logical database in Postgres.
projectstringThe id of the database project associated with the table. Of the format projects/{project_id}.
table_serving_urlstringREST API URL for serving data from this table.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectname, deployment_nameGet a Table (non-synced database table for Autoscaling v2 Lakebase projects).
createinsertdeployment_name, tableCreate a Table (non-synced database table for Autoscaling v2 Lakebase projects).
deletedeletename, deployment_nameDelete a Table (non-synced database table for Autoscaling v2 Lakebase projects).

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)
namestringFull three-part (catalog, schema, table) name of the table.

SELECT examples

Get a Table (non-synced database table for Autoscaling v2 Lakebase projects).

SELECT
name,
branch,
database,
project,
table_serving_url
FROM databricks_workspace.postgres.postgres_tables
WHERE name = '{{ name }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;

INSERT examples

Create a Table (non-synced database table for Autoscaling v2 Lakebase projects).

INSERT INTO databricks_workspace.postgres.postgres_tables (
table,
deployment_name
)
SELECT
'{{ table }}' /* required */,
'{{ deployment_name }}'
RETURNING
name,
branch,
database,
project,
table_serving_url
;

DELETE examples

Delete a Table (non-synced database table for Autoscaling v2 Lakebase projects).

DELETE FROM databricks_workspace.postgres.postgres_tables
WHERE name = '{{ name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;