postgres_roles
Creates, updates, deletes, gets or lists a postgres_roles resource.
Overview
| Name | postgres_roles |
| Type | Resource |
| Id | databricks_workspace.postgres.postgres_roles |
Fields
The following fields are returned by SELECT queries:
- list
- get
| Name | Datatype | Description |
|---|---|---|
name | string | Output only. The full resource path of the role. Format: projects/{project_id}/branches/{branch_id}/roles/{role_id} |
role_id | string | The part of the name, chosen by the user when the resource was created. |
create_time | string (date-time) | |
parent | string | The Branch where this Role exists. Format: projects/{project_id}/branches/{branch_id} |
spec | object | The spec contains the role configuration, including identity type, authentication method, and role attributes. |
status | object | Current status of the role, including its identity type, authentication method, and role attributes. |
update_time | string (date-time) |
| Name | Datatype | Description |
|---|---|---|
name | string | Output only. The Full resource name of the synced table in Postgres where (catalog, schema, table) are the UC entity names. Format "synced_tables/{catalog}.{schema}.{table}" For the corresponding source table in the Unity catalog look for the "source_table_full_name" attribute. |
synced_table_id | string | The part of the name, chosen by the user when the resource was created. |
create_time | string (date-time) | |
spec | object | Configuration details of the synced table, such as the source table, scheduling policy, etc. This attribute is specified at creation time and most fields are returned as is on subsequent queries. |
status | object | Synced Table data synchronization status. |
uid | string | The Unity Catalog table ID for this synced table. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | parent, deployment_name | page_size, page_token | Returns a paginated list of Postgres roles in the branch. |
get | select | name, deployment_name | Get a Synced Table. | |
create | insert | parent, deployment_name, role | replace_existing, role_id | Creates a new Postgres role in the branch. |
delete | delete | name, deployment_name | Delete a Synced Table. |
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.
| Name | Datatype | Description |
|---|---|---|
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
name | string | The Full resource name of the synced table, of the format "synced_tables/{catalog}.{schema}.{table}", where (catalog, schema, table) are the UC entity names. |
parent | string | The Branch where this Role is created. Format: projects/{project_id}/branches/{branch_id} |
page_size | integer | Upper bound for items returned. Cannot be negative. |
page_token | string | Page token from a previous response. If not provided, returns the first page. |
replace_existing | boolean | If true, update the role if it already exists instead of returning an error. When the role already exists, the provided role spec fully replaces the existing one: membership_roles is overwritten, not merged. Leaving membership_roles empty clears all of the role's existing memberships, including DATABRICKS_SUPERUSER. Always send the complete desired list of memberships when using this field. |
role_id | string | The ID to use for the Role, which will become the final component of the role's resource name. This ID becomes the role in Postgres. This value should be 4-63 characters, and valid characters are lowercase letters, numbers, and hyphens, as defined by RFC 1123. If role_id is not specified in the request, it is generated automatically. |
SELECT examples
- list
- get
Returns a paginated list of Postgres roles in the branch.
SELECT
name,
role_id,
create_time,
parent,
spec,
status,
update_time
FROM databricks_workspace.postgres.postgres_roles
WHERE parent = '{{ parent }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND page_size = '{{ page_size }}'
AND page_token = '{{ page_token }}'
;
Get a Synced Table.
SELECT
name,
synced_table_id,
create_time,
spec,
status,
uid
FROM databricks_workspace.postgres.postgres_roles
WHERE name = '{{ name }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;
INSERT examples
- create
- Manifest
Creates a new Postgres role in the branch.
INSERT INTO databricks_workspace.postgres.postgres_roles (
role,
parent,
deployment_name,
replace_existing,
role_id
)
SELECT
'{{ role }}' /* required */,
'{{ parent }}',
'{{ deployment_name }}',
'{{ replace_existing }}',
'{{ role_id }}'
;
# Description fields are for documentation purposes
- name: postgres_roles
props:
- name: parent
value: "{{ parent }}"
description: Required parameter for the postgres_roles resource.
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the postgres_roles resource.
- name: role
description: |
The desired specification of a Role.
value:
create_time: "{{ create_time }}"
name: "{{ name }}"
parent: "{{ parent }}"
role_id: "{{ role_id }}"
spec:
attributes:
bypassrls: {{ bypassrls }}
createdb: {{ createdb }}
createrole: {{ createrole }}
auth_method: "{{ auth_method }}"
identity_type: "{{ identity_type }}"
membership_roles:
- "{{ membership_roles }}"
postgres_role: "{{ postgres_role }}"
status:
attributes:
bypassrls: {{ bypassrls }}
createdb: {{ createdb }}
createrole: {{ createrole }}
auth_method: "{{ auth_method }}"
identity_type: "{{ identity_type }}"
membership_roles:
- "{{ membership_roles }}"
postgres_role: "{{ postgres_role }}"
role_id: "{{ role_id }}"
update_time: "{{ update_time }}"
- name: replace_existing
value: {{ replace_existing }}
description: If true, update the role if it already exists instead of returning an error. When the role already exists, the provided ``role`` spec fully replaces the existing one: ``membership_roles`` is overwritten, not merged. Leaving ``membership_roles`` empty clears all of the role's existing memberships, including ``DATABRICKS_SUPERUSER``. Always send the complete desired list of memberships when using this field.
description: If true, update the role if it already exists instead of returning an error. When the role already exists, the provided ``role`` spec fully replaces the existing one: ``membership_roles`` is overwritten, not merged. Leaving ``membership_roles`` empty clears all of the role's existing memberships, including ``DATABRICKS_SUPERUSER``. Always send the complete desired list of memberships when using this field.
- name: role_id
value: "{{ role_id }}"
description: The ID to use for the Role, which will become the final component of the role's resource name. This ID becomes the role in Postgres. This value should be 4-63 characters, and valid characters are lowercase letters, numbers, and hyphens, as defined by RFC 1123. If role_id is not specified in the request, it is generated automatically.
description: The ID to use for the Role, which will become the final component of the role's resource name. This ID becomes the role in Postgres. This value should be 4-63 characters, and valid characters are lowercase letters, numbers, and hyphens, as defined by RFC 1123. If role_id is not specified in the request, it is generated automatically.
DELETE examples
- delete
Delete a Synced Table.
DELETE FROM databricks_workspace.postgres.postgres_roles
WHERE name = '{{ name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;