Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ You interact with the Control Plane via an HTTP API. Once you've initialized a C
At a high level, the pgEdge Control Plane supports:

- deploying Postgres 16, 17, and 18 with support for managed extensions.
- Extension support includes: Spock, LOLOR, Snowflake, pgAudit, PostGIS, pgVector.
- Extension support includes: Spock, LOLOR, Snowflake, pgAudit, PostGIS, pgVector, pgEdge Vectorizer, pg_tokenizer, vchord_bm25, pg_vectorize, pgmq, pg_cron, pg_stat_monitor.
- deploying multiple Postgres instances on the same host, enabling efficient resource utilization and consolidation of workloads.
- flexible deployment options for both single-region and multi-region deployments. You can:
- deploy to a single region with optional standby replicas.
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ resolving the underlying issue.
The pgEdge Control Plane supports:

- deploying Postgres 16, 17, and 18 with support for managed extensions.
- Extension support includes: Spock, LOLOR, Snowflake, pgAudit, PostGIS, pgVector.
- Extension support includes: Spock, LOLOR, Snowflake, pgAudit, PostGIS, pgVector, pgEdge Vectorizer, pg_tokenizer, vchord_bm25, pg_vectorize, pgmq, pg_cron, pg_stat_monitor.
- deploying multiple Postgres instances on the same host, enabling efficient resource utilization and consolidation of workloads.
- flexible deployment options for both single-region and multi-region deployments. You can:
- deploy to a single region with optional standby replicas.
Expand Down
101 changes: 71 additions & 30 deletions docs/using/create-db.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,46 +79,87 @@ the response:
You can also use the task ID from the original response to retrieve logs and
other details from the creation process. See the [Tasks and Logs](tasks-logs.md) for more information.

## Customizing Database Configuration

There are many other database settings that you can customize when creating or
updating a database. Settings in the `spec` object will apply to all distributed nodes. You can also apply or override a setting on a specific node by setting it in the node's object in `spec.nodes[]`.

This example request alters the `max_connections` value for all nodes and overrides the port just for the `n1` node:

```sh
curl -X POST http://host-3:3000/v1/databases \
-H 'Content-Type:application/json' \
--data '{
"id": "example",
"spec": {
"database_name": "example",
"database_users": [
{
"username": "admin",
"password": "password",
"db_owner": true,
"attributes": ["SUPERUSER", "LOGIN"]
}
],
"port": 5432,
"postgresql_conf": {
"max_connections": 5000
},
"nodes": [
{
"name": "n1",
"host_ids": ["host-1"],
"port": 6432
=== "curl"

```sh
curl -X POST http://host-3:3000/v1/databases \
-H 'Content-Type:application/json' \
--data '{
"id": "example",
"spec": {
"database_name": "example",
"database_users": [
{
"username": "admin",
"password": "password",
"db_owner": true,
"attributes": ["SUPERUSER", "LOGIN"]
}
],
"port": 5432,
"postgresql_conf": {
"max_connections": 5000
},
{ "name": "n2", "host_ids": ["host-2"] },
{ "name": "n3", "host_ids": ["host-3"] }
]
}
}'
```
"nodes": [
{
"name": "n1",
"host_ids": ["host-1"],
"port": 6432
},
{ "name": "n2", "host_ids": ["host-2"] },
{ "name": "n3", "host_ids": ["host-3"] }
]
}
}'
```

!!! warning

The pgEdge Control Plane is designed to ensure that configuration is applied during database operations. It is not recommended to apply configuration directly to underlying components, including Postgres, since those changes may be overwritten or reverted. You should instead use the Control Plane to manage Postgres configuration for consistency reasons.

Refer to the [API Reference](../api/reference.md) for details on all
available settings.

## Extension Support

The Control Plane supports all extensions included in the standard flavor of the [pgEdge Enterprise Postgres Image](https://github.com/pgedge/postgres-images?tab=readme-ov-file#standard-images). You can configure extension-related settings using the `postgresql_conf` object in your database specification.

To support extension configuration, the Control Plane allows setting `shared_preload_libraries` in the `postgresql_conf` field on the database spec. If your extension requires additional configuration parameters, you can also include them in the `postgresql_conf` parameter.

By default, `shared_preload_libraries` contains `pg_stat_statements`, `snowflake`, `spock`, and `postgis`.

In this example, the `shared_preload_libraries` parameter is set to load both `spock` and `pg_cron` extensions when the database starts, and `pg_cron`
is further configured using the `cron.database_name` parameter:

=== "curl"

```sh
curl -X POST http://host-3:3000/v1/databases \
-H 'Content-Type:application/json' \
--data '{
"id": "example",
"spec": {
"database_name": "example",
"postgresql_conf": {
"shared_preload_libraries": "spock,pg_cron",
"cron.database_name": "example"
},
"nodes": [
{ "name": "n1", "host_ids": ["host-1"] }
]
}
}'
```

After creating the database, you can enable extensions in your database using `CREATE EXTENSION`.

!!! note

Always include `spock` in `shared_preload_libraries`, as it is required for core functionality provided by the Control Plane. The Control Plane will call `CREATE EXTENSION` for spock when initializing each instance.
12 changes: 6 additions & 6 deletions server/internal/orchestrator/swarm/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,26 @@ func NewVersions(cfg config.Config) *Versions {

// pg16
versions.addImage(host.MustPgEdgeVersion("16.10", "5"), &Images{
PgEdgeImage: imageTag(cfg, "16.10-spock5.0.4-standard-1"),
PgEdgeImage: imageTag(cfg, "16.10-spock5.0.4-standard-2"),
})
versions.addImage(host.MustPgEdgeVersion("16.11", "5"), &Images{
PgEdgeImage: imageTag(cfg, "16.11-spock5.0.4-standard-1"),
PgEdgeImage: imageTag(cfg, "16.11-spock5.0.4-standard-3"),
})

// pg17
versions.addImage(host.MustPgEdgeVersion("17.6", "5"), &Images{
PgEdgeImage: imageTag(cfg, "17.6-spock5.0.4-standard-1"),
PgEdgeImage: imageTag(cfg, "17.6-spock5.0.4-standard-2"),
})
versions.addImage(host.MustPgEdgeVersion("17.7", "5"), &Images{
PgEdgeImage: imageTag(cfg, "17.7-spock5.0.4-standard-1"),
PgEdgeImage: imageTag(cfg, "17.7-spock5.0.4-standard-3"),
})

// pg18
versions.addImage(host.MustPgEdgeVersion("18.0", "5"), &Images{
PgEdgeImage: imageTag(cfg, "18.0-spock5.0.4-standard-1"),
PgEdgeImage: imageTag(cfg, "18.0-spock5.0.4-standard-2"),
})
versions.addImage(host.MustPgEdgeVersion("18.1", "5"), &Images{
PgEdgeImage: imageTag(cfg, "18.1-spock5.0.4-standard-1"),
PgEdgeImage: imageTag(cfg, "18.1-spock5.0.4-standard-3"),
})

versions.defaultVersion = host.MustPgEdgeVersion("18.1", "5")
Expand Down