Schema manager
PgDog provides several tools for sharded schema management. Currently, most of the functionality is implemented in Postgres with pl/PgSQL functions. To take advantage of it, you need to install these functions into your sharded database.
Installation
To install schema management functionality into your database, run the following command:
The --database
parameter expects the name of the sharded database in pgdog.toml
. This will create the following entities:
Entity type | Name | Description |
---|---|---|
Schema | pgdog |
The schema which contains functions and tables used for sharding and synchronization. |
Table | pgdog.config |
Table with configuration options specific to each shard, e.g., shard number, total number of shards, etc. |
Function | pgdog.next_id_seq |
Globally unique ID generation for BIGINT columns. |
Function | pgdog.next_uuid_auto |
Globally unique UUID generation for UUID columns. |