Skip to content
Merged
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
81 changes: 81 additions & 0 deletions docs/referenceguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Table of contents
- [pgactive configuration variables (GUC)](#pgactive-configuration-variables)
- [Active-Active conflicts](#active-active-conflicts)
- [pgactive schema](#pgactive-schema)
- [Replication sets](#replication-sets)
- [Functions](#functions)

Expand Down Expand Up @@ -330,6 +331,86 @@ Row values may optionally be logged for row conflicts. This is controlled by the

Because the conflict history table contains data on every table in the database so each row's schema might be different, if row values are logged they are stored as json fields. The json is created with row_to_json, just like if you'd called it on the row yourself from SQL. There is no corresponding json_to_row function in PostgreSQL at this time, so you'll need table-specific code (pl/pgsql, pl/python, pl/perl, whatever) if you want to reconstruct a composite-typed tuple from the logged json.

## pgactive schema

* pgactive schema is evolving, schema is subject to change

* Do not change these tables for table data.

pgactive key tables are following:

### pgactive_nodes

```
Table "pgactive.pgactive_nodes"
Column | Type | Collation | Nullable | Default
--------------------+----------+-----------+----------+---------
node_sysid | text | | not null |
node_timeline | oid | | not null |
node_dboid | oid | | not null |
node_status | "char" | | not null |
node_name | text | | not null |
node_dsn | text | | |
node_init_from_dsn | text | | |
node_read_only | boolean | | | false
node_seq_id | smallint | | |
```

#### node_sysid

Unique id for a node, generated during pgactive_create_group or pgactive_join_group

#### node_status

Readiness of the node:

- [b]eginning setup
- [i]nitializing
- [c]atchup
- creating [o]utbound slots
- [r]eady
- [k]illed

This column doesn't indicate if a node is connected or disconnected.

#### node_name

User provided unique node name.

#### node_dsn

Connection string or user mapping name

#### node_init_from_dsn

DSN from which this node was created.

### pgactive_connections

```
Table "pgactive.pgactive_connections"
Column | Type | Collation | Nullable | Default
-----------------------+---------+-----------+----------+---------
conn_sysid | text | | not null |
conn_timeline | oid | | not null |
conn_dboid | oid | | not null |
conn_dsn | text | | not null |
conn_apply_delay | integer | | |
conn_replication_sets | text[] | | |
```

#### conn_sysid

Node identifier for the node this entry refers to

#### conn_dsn

Same as pgactive.pgactive_nodes "node_dsn".

#### conn_apply_delay

If set, milliseconds to wait before applying each transaction from the remote node. Mainly for debugging. If null, the global default applies.

## Replication sets

Replication sets provide a way to define which tables are included or excluded from replication.
Expand Down