Aller au contenu principal

PostgreSQL extensions

All paths below use https://api.lordbase.com. Read conventions for headers, authentication, pagination and error handling. Values in responses are illustrative; examples show selected fields, not fixed quotas or service guarantees.

Developer tokens authorize only explicitly supported operations. Required scopes appear below; account, billing and token-management operations require a dashboard session. See token permissions.

List PostgreSQL extensions — GET​

GET /e/v1/developer/databases/{database_id}/extensions/

Authentication: Authenticated developer with an active Lordbase subscription. Use the dashboard session, or Authorization: Bearer YOUR_DEVELOPER_TOKEN with read_databases (or api). Resource roles and quotas still apply.

Request and permissions: Workspace member; PostgreSQL only. No body. An inactive database returns 200 with an empty extensions list and a message. An active database returns the available, installed and allowed catalogues.

Required path parameters: database_id (UUID).

Response: 200

{
"database_id": "11111111-1111-4111-8111-111111111111",
"database_name": "Example PostgreSQL",
"available_extensions": [
{
"name": "pgcrypto",
"version": "1.3",
"description": "Cryptographic functions",
"installed": false,
"installed_version": null,
"is_safe": true,
"requires_superuser": false
}
],
"installed_extensions": [],
"safe_extensions": [
{
"name": "pgcrypto",
"description": "Cryptographic functions",
"requires_superuser": false
}
]
}

Failures: Common API errors, plus the validation, role, state, engine and plan restrictions stated above.

Enable a PostgreSQL extension — POST​

POST /e/v1/developer/databases/{database_id}/extensions/{extension_name}/enable/

Authentication: Authenticated developer with an active Lordbase subscription. Use the dashboard session, or Authorization: Bearer YOUR_DEVELOPER_TOKEN with write_databases (or api). Resource roles and quotas still apply.

Request and permissions: Owner/admin; active PostgreSQL database. Extension name is required in the path; no body. Use the allowed catalogue. Failure returns 400 with success:false.

Required path parameters: database_id (UUID); extension_name (URL-encoded string).

Response: 200

{
"database_id": "11111111-1111-4111-8111-111111111111",
"extension": "pgcrypto",
"success": true,
"message": "Extension enabled successfully"
}

Failures: Common API errors, plus the validation, role, state, engine and plan restrictions stated above.

Disable a PostgreSQL extension — POST​

POST /e/v1/developer/databases/{database_id}/extensions/{extension_name}/disable/

Authentication: Authenticated developer with an active Lordbase subscription. Use the dashboard session, or Authorization: Bearer YOUR_DEVELOPER_TOKEN with write_databases (or api). Resource roles and quotas still apply.

Request and permissions: Owner/admin; active PostgreSQL database. Extension name is required in the path; no body. Use the allowed catalogue. Failure returns 400 with success:false. Removing an extension can affect objects that depend on it.

Required path parameters: database_id (UUID); extension_name (URL-encoded string).

Response: 200

{
"database_id": "11111111-1111-4111-8111-111111111111",
"extension": "pgcrypto",
"success": true,
"message": "Extension disabled successfully"
}

Failures: Common API errors, plus the validation, role, state, engine and plan restrictions stated above.

Read the allowed extension catalogue — GET​

GET /e/v1/developer/extensions/safe/

Authentication: Authenticated developer with an active Lordbase subscription. Use the dashboard session, or Authorization: Bearer YOUR_DEVELOPER_TOKEN with read_databases (or api). Resource roles and quotas still apply.

Request and permissions: Authenticated developer; no body. Allowed names do not guarantee the extension is installed/available on every server.

Response: 200

{
"extensions": [
{
"name": "pgcrypto",
"description": "Cryptographic functions",
"requires_superuser": false
}
],
"count": 1
}

Failures: Common API errors, plus the validation, role, state, engine and plan restrictions stated above.