Items - Get Postgre SQL Database Definition
Gets the PostgreSQL database definition.
Note
PostgreSQLDatabase item is currently in Preview (learn more).
This API supports long running operations (LRO).
Gets the authored PostgreSQL schema in the pgschema definition format. The exported definition does not include table data, credentials, connection details, the item display name, the item description, or the sensitivity label.
Permissions
The caller must have read and write permissions for the PostgreSQL database.
Required Delegated Scopes
Item.ReadWrite.All
Required Tenant Settings
To use this API, enable the PostgreSQL database (preview) admin switch for the calling principal.
Limitations
To retrieve the definition of a PostgreSQL database item protected by an encrypted sensitivity label, the caller must have sufficient usage rights to remove the label, as configured in Microsoft Purview.
Microsoft Entra supported identities
This API supports the Microsoft identities listed in this section.
| Identity | Support |
|---|---|
| User | Yes |
| Service principal and Managed identities | Yes |
Interface
POST https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/postgreSQLDatabases/{postgreSQLDatabaseId}/getDefinition
POST https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/postgreSQLDatabases/{postgreSQLDatabaseId}/getDefinition?format={format}
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
postgre
|
path | True |
string (uuid) |
The PostgreSQL database ID. |
|
workspace
|
path | True |
string (uuid) |
The workspace ID. |
|
format
|
query |
string |
The format of the PostgreSQL database public definition. The supported value is |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
Request completed successfully. |
|
| 202 Accepted |
Request accepted. Retrieving the definition is in progress. Headers: Location x-ms-operation-id Retry-After |
|
| 429 Too Many Requests |
The service rate limit was exceeded. The server returns a Headers Retry-After: integer |
|
| Other Status Codes |
Common error codes:
|
Examples
Get a PostgreSQL database definition example
Sample request
POST https://api.fabric.microsoft.com/v1/workspaces/11111111-2222-3333-4444-555555555555/postgreSQLDatabases/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee/getDefinition?format=pgschema
Sample response
{
"definition": {
"format": "pgschema",
"parts": [
{
"path": "definition.pgschema",
"payload": "UEsDBBQAAAAAAAAAISgN3c61pgAAAKYAAAANAAAAbWF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AAAAAAhKJvoLSGkAAAApAAAABcAAAAAAAAAAAAAAAAAMgEAAHNhbGVzL3RhYmxlcy9vcmRlcnMuc3FsUEsBAhQAFAAAAAAAAAAhKKNy3nmAAAAAgAAAABwAAAAAAAAAAAAAAAAACwIAAHNhbGVzL3ZpZXdzL29yZGVyX3RvdGFscy5zcWxQSwUGAAAAAAQABAAAAQAAxQIAAAAA",
"payloadType": "InlineBase64"
}
]
}
}
Location: https://api.fabric.microsoft.com/v1/operations/9bf413a7-b1eb-47c7-a682-35180bfe5c10
x-ms-operation-id: 9bf413a7-b1eb-47c7-a682-35180bfe5c10
Retry-After: 30
Definitions
| Name | Description |
|---|---|
|
Error |
A structured parameter providing additional machine-readable context about an error. |
|
Error |
The error related resource details object. |
|
Error |
The error response. |
|
Error |
The error response details. |
|
Payload |
The type of the definition part payload. Additional payload types may be added over time. |
|
Postgre |
The PostgreSQL database public definition object in the |
|
Postgre |
The format of the PostgreSQL database definition. Additional |
|
Postgre |
A PostgreSQL database definition part object. |
|
Postgre |
The response payload for a PostgreSQL database definition. |
ErrorParameter
A structured parameter providing additional machine-readable context about an error.
| Name | Type | Description |
|---|---|---|
| message |
string |
A human-readable description of the parameter's meaning. |
| name |
string |
The parameter identifier. |
| value |
string |
The parameter value. |
ErrorRelatedResource
The error related resource details object.
| Name | Type | Description |
|---|---|---|
| resourceId |
string |
The resource ID that's involved in the error. |
| resourceType |
string |
The type of the resource that's involved in the error. |
ErrorResponse
The error response.
| Name | Type | Description |
|---|---|---|
| errorCode |
string |
A specific identifier that provides information about an error condition, allowing for standardized communication between our service and its users. |
| isRetriable |
boolean |
When true, the request can be retried. Use the |
| message |
string |
A human readable representation of the error. |
| moreDetails |
List of additional error details. |
|
| parameters |
Structured parameters providing additional machine-readable context about the error. |
|
| relatedResource |
The error related resource details. |
|
| requestId |
string (uuid) |
ID of the request associated with the error. |
ErrorResponseDetails
The error response details.
| Name | Type | Description |
|---|---|---|
| errorCode |
string |
A specific identifier that provides information about an error condition, allowing for standardized communication between our service and its users. |
| message |
string |
A human readable representation of the error. |
| parameters |
Structured parameters providing additional machine-readable context about the error. |
|
| relatedResource |
The error related resource details. |
PayloadType
The type of the definition part payload. Additional payload types may be added over time.
| Value | Description |
|---|---|
| InlineBase64 |
Inline Base 64. |
PostgreSQLDatabaseDefinition
The PostgreSQL database public definition object in the pgschema format. Refer to this article for more details on the structure of the PostgreSQL database definition.
| Name | Type | Description |
|---|---|---|
| format |
The format of the PostgreSQL database definition. Additional |
|
| parts |
A list containing exactly one required |
PostgreSqlDatabaseDefinitionFormat
The format of the PostgreSQL database definition. Additional format types may be added over time.
| Value | Description |
|---|---|
| pgschema |
The |
PostgreSQLDatabaseDefinitionPart
A PostgreSQL database definition part object.
| Name | Type | Description |
|---|---|---|
| path |
string |
The PostgreSQL database definition part path. The workload part path is |
| payload |
string |
The Base64-encoded PostgreSQL database definition part payload. |
| payloadType |
The payload type. |
PostgreSQLDatabaseDefinitionResponse
The response payload for a PostgreSQL database definition.
| Name | Type | Description |
|---|---|---|
| definition |
The PostgreSQL database definition. |