pg_statecharts
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_statecharts | 0.1.0 | FEAT | MIT | SQL |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 2695 | pg_statecharts | No | No | No | Yes | No | No | fsm |
| 2696 | pg_statecharts_dev | No | No | No | Yes | No | No | fsm |
| Related | ltree |
|---|---|
| Depended By | pg_statecharts_dev |
ltree in public
Version
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 0.1.0 el8.x86_64.pg18 : pg_statecharts_18 pg_statecharts_18-0.1.0-1PGSTY.el8.noarch.rpm
| PIGSTY 0.1.0 el8.x86_64.pg17 : pg_statecharts_17 pg_statecharts_17-0.1.0-1PGSTY.el8.noarch.rpm
| PIGSTY 0.1.0 el8.x86_64.pg16 : pg_statecharts_16 pg_statecharts_16-0.1.0-1PGSTY.el8.noarch.rpm
| N/A | N/A |
| el8.aarch64 | PIGSTY 0.1.0 el8.aarch64.pg18 : pg_statecharts_18 pg_statecharts_18-0.1.0-1PGSTY.el8.noarch.rpm
| PIGSTY 0.1.0 el8.aarch64.pg17 : pg_statecharts_17 pg_statecharts_17-0.1.0-1PGSTY.el8.noarch.rpm
| PIGSTY 0.1.0 el8.aarch64.pg16 : pg_statecharts_16 pg_statecharts_16-0.1.0-1PGSTY.el8.noarch.rpm
| N/A | N/A |
| el9.x86_64 | PIGSTY 0.1.0 el9.x86_64.pg18 : pg_statecharts_18 pg_statecharts_18-0.1.0-1PGSTY.el9.noarch.rpm
| PIGSTY 0.1.0 el9.x86_64.pg17 : pg_statecharts_17 pg_statecharts_17-0.1.0-1PGSTY.el9.noarch.rpm
| PIGSTY 0.1.0 el9.x86_64.pg16 : pg_statecharts_16 pg_statecharts_16-0.1.0-1PGSTY.el9.noarch.rpm
| N/A | N/A |
| el9.aarch64 | PIGSTY 0.1.0 el9.aarch64.pg18 : pg_statecharts_18 pg_statecharts_18-0.1.0-1PGSTY.el9.noarch.rpm
| PIGSTY 0.1.0 el9.aarch64.pg17 : pg_statecharts_17 pg_statecharts_17-0.1.0-1PGSTY.el9.noarch.rpm
| PIGSTY 0.1.0 el9.aarch64.pg16 : pg_statecharts_16 pg_statecharts_16-0.1.0-1PGSTY.el9.noarch.rpm
| N/A | N/A |
| el10.x86_64 | PIGSTY 0.1.0 el10.x86_64.pg18 : pg_statecharts_18 pg_statecharts_18-0.1.0-1PGSTY.el10.noarch.rpm
| PIGSTY 0.1.0 el10.x86_64.pg17 : pg_statecharts_17 pg_statecharts_17-0.1.0-1PGSTY.el10.noarch.rpm
| PIGSTY 0.1.0 el10.x86_64.pg16 : pg_statecharts_16 pg_statecharts_16-0.1.0-1PGSTY.el10.noarch.rpm
| N/A | N/A |
| el10.aarch64 | PIGSTY 0.1.0 el10.aarch64.pg18 : pg_statecharts_18 pg_statecharts_18-0.1.0-1PGSTY.el10.noarch.rpm
| PIGSTY 0.1.0 el10.aarch64.pg17 : pg_statecharts_17 pg_statecharts_17-0.1.0-1PGSTY.el10.noarch.rpm
| PIGSTY 0.1.0 el10.aarch64.pg16 : pg_statecharts_16 pg_statecharts_16-0.1.0-1PGSTY.el10.noarch.rpm
| N/A | N/A |
| d12.x86_64 | PIGSTY 0.1.0 d12.x86_64.pg18 : postgresql-18-pg-statecharts postgresql-18-pg-statecharts_0.1.0-1PGSTY~bookworm_all.deb
| PIGSTY 0.1.0 d12.x86_64.pg17 : postgresql-17-pg-statecharts postgresql-17-pg-statecharts_0.1.0-1PGSTY~bookworm_all.deb
| PIGSTY 0.1.0 d12.x86_64.pg16 : postgresql-16-pg-statecharts postgresql-16-pg-statecharts_0.1.0-1PGSTY~bookworm_all.deb
| N/A | N/A |
| d12.aarch64 | PIGSTY 0.1.0 d12.aarch64.pg18 : postgresql-18-pg-statecharts postgresql-18-pg-statecharts_0.1.0-1PGSTY~bookworm_all.deb
| PIGSTY 0.1.0 d12.aarch64.pg17 : postgresql-17-pg-statecharts postgresql-17-pg-statecharts_0.1.0-1PGSTY~bookworm_all.deb
| PIGSTY 0.1.0 d12.aarch64.pg16 : postgresql-16-pg-statecharts postgresql-16-pg-statecharts_0.1.0-1PGSTY~bookworm_all.deb
| N/A | N/A |
| d13.x86_64 | PIGSTY 0.1.0 d13.x86_64.pg18 : postgresql-18-pg-statecharts postgresql-18-pg-statecharts_0.1.0-1PGSTY~trixie_all.deb
| PIGSTY 0.1.0 d13.x86_64.pg17 : postgresql-17-pg-statecharts postgresql-17-pg-statecharts_0.1.0-1PGSTY~trixie_all.deb
| PIGSTY 0.1.0 d13.x86_64.pg16 : postgresql-16-pg-statecharts postgresql-16-pg-statecharts_0.1.0-1PGSTY~trixie_all.deb
| N/A | N/A |
| d13.aarch64 | PIGSTY 0.1.0 d13.aarch64.pg18 : postgresql-18-pg-statecharts postgresql-18-pg-statecharts_0.1.0-1PGSTY~trixie_all.deb
| PIGSTY 0.1.0 d13.aarch64.pg17 : postgresql-17-pg-statecharts postgresql-17-pg-statecharts_0.1.0-1PGSTY~trixie_all.deb
| PIGSTY 0.1.0 d13.aarch64.pg16 : postgresql-16-pg-statecharts postgresql-16-pg-statecharts_0.1.0-1PGSTY~trixie_all.deb
| N/A | N/A |
| u22.x86_64 | PIGSTY 0.1.0 u22.x86_64.pg18 : postgresql-18-pg-statecharts postgresql-18-pg-statecharts_0.1.0-1PGSTY~jammy_all.deb
| PIGSTY 0.1.0 u22.x86_64.pg17 : postgresql-17-pg-statecharts postgresql-17-pg-statecharts_0.1.0-1PGSTY~jammy_all.deb
| PIGSTY 0.1.0 u22.x86_64.pg16 : postgresql-16-pg-statecharts postgresql-16-pg-statecharts_0.1.0-1PGSTY~jammy_all.deb
| N/A | N/A |
| u22.aarch64 | PIGSTY 0.1.0 u22.aarch64.pg18 : postgresql-18-pg-statecharts postgresql-18-pg-statecharts_0.1.0-1PGSTY~jammy_all.deb
| PIGSTY 0.1.0 u22.aarch64.pg17 : postgresql-17-pg-statecharts postgresql-17-pg-statecharts_0.1.0-1PGSTY~jammy_all.deb
| PIGSTY 0.1.0 u22.aarch64.pg16 : postgresql-16-pg-statecharts postgresql-16-pg-statecharts_0.1.0-1PGSTY~jammy_all.deb
| N/A | N/A |
| u24.x86_64 | PIGSTY 0.1.0 u24.x86_64.pg18 : postgresql-18-pg-statecharts postgresql-18-pg-statecharts_0.1.0-1PGSTY~noble_all.deb
| PIGSTY 0.1.0 u24.x86_64.pg17 : postgresql-17-pg-statecharts postgresql-17-pg-statecharts_0.1.0-1PGSTY~noble_all.deb
| PIGSTY 0.1.0 u24.x86_64.pg16 : postgresql-16-pg-statecharts postgresql-16-pg-statecharts_0.1.0-1PGSTY~noble_all.deb
| N/A | N/A |
| u24.aarch64 | PIGSTY 0.1.0 u24.aarch64.pg18 : postgresql-18-pg-statecharts postgresql-18-pg-statecharts_0.1.0-1PGSTY~noble_all.deb
| PIGSTY 0.1.0 u24.aarch64.pg17 : postgresql-17-pg-statecharts postgresql-17-pg-statecharts_0.1.0-1PGSTY~noble_all.deb
| PIGSTY 0.1.0 u24.aarch64.pg16 : postgresql-16-pg-statecharts postgresql-16-pg-statecharts_0.1.0-1PGSTY~noble_all.deb
| N/A | N/A |
| u26.x86_64 | PIGSTY 0.1.0 u26.x86_64.pg18 : postgresql-18-pg-statecharts postgresql-18-pg-statecharts_0.1.0-1PGSTY~resolute_all.deb
| PIGSTY 0.1.0 u26.x86_64.pg17 : postgresql-17-pg-statecharts postgresql-17-pg-statecharts_0.1.0-1PGSTY~resolute_all.deb
| PIGSTY 0.1.0 u26.x86_64.pg16 : postgresql-16-pg-statecharts postgresql-16-pg-statecharts_0.1.0-1PGSTY~resolute_all.deb
| N/A | N/A |
| u26.aarch64 | PIGSTY 0.1.0 u26.aarch64.pg18 : postgresql-18-pg-statecharts postgresql-18-pg-statecharts_0.1.0-1PGSTY~resolute_all.deb
| PIGSTY 0.1.0 u26.aarch64.pg17 : postgresql-17-pg-statecharts postgresql-17-pg-statecharts_0.1.0-1PGSTY~resolute_all.deb
| PIGSTY 0.1.0 u26.aarch64.pg16 : postgresql-16-pg-statecharts postgresql-16-pg-statecharts_0.1.0-1PGSTY~resolute_all.deb
| N/A | N/A |
Build
You can build the RPM / DEB packages for pg_statecharts using pig build:
Install
You can install pg_statecharts directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Create Extension:
Usage
Sources:
pg_statecharts 0.1.0 runs hierarchical state machines and their events transactionally inside PostgreSQL. This release is pure SQL, tested on PostgreSQL 16–18, and needs no preload or restart.
Core Workflow
Install ltree in public, then install the extension with a role that has the required object-creation privileges:
Deploy a statechart definition through SQL migrations or the development companion before starting a machine. For an already deployed chart named order, this starts its latest version and returns the machine row:
Events are inserted into fsm.state_machine_event with the shard, machine identifier, event name and JSON data. Its triggers process the event in the inserting transaction, including entry and exit callbacks. Callers must have the appropriate table and function privileges; chart callbacks are application code that needs its own review.
Catalog and Versions
Definitions and running machines live in fsm. fsm.to_semver parses numeric chart versions and fsm.semver_text renders them; stored versions are integer arrays so their native ordering remains numeric. Do not sort a textual rendering when version precedence matters.
Backups and Legacy Migration
The reviewed 0.1.0 source registers state tables and sequences for database dumps. The event inbox is intentionally omitted to avoid replaying callbacks during restoration. Backups made with 0.0.0 omitted machine state; take a fresh, restore-tested backup after upgrading.
An earlier 0.1.0 installation may predate dump registration, so check the installed catalog instead of trusting its version string. Do not drop a populated extension merely to refresh registration. Legacy Rust or Sqitch migrations require superuser work and the old semver dependency during conversion; follow the migration guide and rehearse on a restored copy. The old 0.0.0 path is no longer independently exercised upstream.
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)