Edit

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
postgreSQLDatabaseId
path True

string (uuid)

The PostgreSQL database ID.

workspaceId
path True

string (uuid)

The workspace ID.

format
query

string

The format of the PostgreSQL database public definition. The supported value is pgschema.

Responses

Name Type Description
200 OK

PostgreSQLDatabaseDefinitionResponse

Request completed successfully.

202 Accepted

Request accepted. Retrieving the definition is in progress.


Headers:

Location string - The URL of the operation status, which can be used to track the operation state.

x-ms-operation-id string (uuid) - The operation ID which can be used with long running operations (LRO) APIs to track the operation state and get the result.

Retry-After integer - The number of seconds to wait before retrying the request.

429 Too Many Requests

ErrorResponse

The service rate limit was exceeded. The server returns a Retry-After header indicating, in seconds, how long the client must wait before sending additional requests.

Headers

Retry-After: integer

Other Status Codes

ErrorResponse

Common error codes:

  • OperationNotSupportedForItem - Operation not supported for requested item.

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": "UEsDBBQAAAAAAAAAISgN3c61pgAAAKYAAAANAAAAbWFuaWZlc3QuanNvbnsiJHNjaGVtYSI6Imh0dHBzOi8vZGV2ZWxvcGVyLm1pY3Jvc29mdC5jb20vanNvbi1zY2hlbWFzL2ZhYnJpYy9pdGVtL3Bvc3RncmVTUUxEYXRhYmFzZS9kZWZpbml0aW9uL21hbmlmZXN0LzEuMC4wL3NjaGVtYS5qc29uIiwiZm9ybWF0IjoicGdzY2hlbWEiLCJ2ZXJzaW9uIjoiMS4wLjAifQpQSwMEFAAAAAAAAAAhKG2W9BY7AAAAOwAAAAgAAABtYWluLnNxbFxpIHNhbGVzL3RhYmxlcy9vcmRlcnMuc3FsClxpIHNhbGVzL3ZpZXdzL29yZGVyX3RvdGFscy5zcWwKUEsDBBQAAAAAAAAAISib6C0hpAAAAKQAAAAXAAAAc2FsZXMvdGFibGVzL29yZGVycy5zcWxDUkVBVEUgVEFCTEUgc2FsZXMub3JkZXJzICgKICAgIG9yZGVyX2lkIGJpZ2ludCBQUklNQVJZIEtFWSwKICAgIGN1c3RvbWVyX2lkIGJpZ2ludCBOT1QgTlVMTCwKICAgIHRvdGFsX2Ftb3VudCBudW1lcmljKDEyLCAyKSBOT1QgTlVMTCBDSEVDSyAodG90YWxfYW1vdW50ID49IDApCik7ClBLAwQUAAAAAAAAACEoo3LeeYAAAACAAAAAHAAAAHNhbGVzL3ZpZXdzL29yZGVyX3RvdGFscy5zcWxDUkVBVEUgVklFVyBzYWxlcy5vcmRlcl90b3RhbHMgQVMKU0VMRUNUIGN1c3RvbWVyX2lkLCBzdW0odG90YWxfYW1vdW50KSBBUyB0b3RhbF9hbW91bnQKRlJPTSBzYWxlcy5vcmRlcnMKR1JPVVAgQlkgY3VzdG9tZXJfaWQ7ClBLAQIUABQAAAAAAAAAISgN3c61pgAAAKYAAAANAAAAAAAAAAAAAAAAAAAAAABtYW5pZmVzdC5qc29uUEsBAhQAFAAAAAAAAAAhKG2W9BY7AAAAOwAAAAgAAAAAAAAAAAAAAAAA0QAAAG1haW4uc3FsUEsBAhQAFAAAAAAAAAAhKJvoLSGkAAAApAAAABcAAAAAAAAAAAAAAAAAMgEAAHNhbGVzL3RhYmxlcy9vcmRlcnMuc3FsUEsBAhQAFAAAAAAAAAAhKKNy3nmAAAAAgAAAABwAAAAAAAAAAAAAAAAACwIAAHNhbGVzL3ZpZXdzL29yZGVyX3RvdGFscy5zcWxQSwUGAAAAAAQABAAAAQAAxQIAAAAA",
        "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
ErrorParameter

A structured parameter providing additional machine-readable context about an error.

ErrorRelatedResource

The error related resource details object.

ErrorResponse

The error response.

ErrorResponseDetails

The error response details.

PayloadType

The type of the definition part payload. Additional payload types may be added over time.

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.

PostgreSqlDatabaseDefinitionFormat

The format of the PostgreSQL database definition. Additional format types may be added over time.

PostgreSQLDatabaseDefinitionPart

A PostgreSQL database definition part object.

PostgreSQLDatabaseDefinitionResponse

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 Retry-After response header to determine the delay, if available.

message

string

A human readable representation of the error.

moreDetails

ErrorResponseDetails[]

List of additional error details.

parameters

ErrorParameter[]

Structured parameters providing additional machine-readable context about the error.

relatedResource

ErrorRelatedResource

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

ErrorParameter[]

Structured parameters providing additional machine-readable context about the error.

relatedResource

ErrorRelatedResource

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

PostgreSqlDatabaseDefinitionFormat

The format of the PostgreSQL database definition. Additional format types may be added over time.

parts

PostgreSQLDatabaseDefinitionPart[]

A list containing exactly one required definition.pgschema workload part and an optional .platform metadata part.

PostgreSqlDatabaseDefinitionFormat

The format of the PostgreSQL database definition. Additional format types may be added over time.

Value Description
pgschema

The pgschema format for PostgreSQL database definitions.

PostgreSQLDatabaseDefinitionPart

A PostgreSQL database definition part object.

Name Type Description
path

string

The PostgreSQL database definition part path. The workload part path is definition.pgschema; an optional .platform part carries Fabric item metadata.

payload

string

The Base64-encoded PostgreSQL database definition part payload.

payloadType

PayloadType

The payload type.

PostgreSQLDatabaseDefinitionResponse

The response payload for a PostgreSQL database definition.

Name Type Description
definition

PostgreSQLDatabaseDefinition

The PostgreSQL database definition.