[HN Gopher] Implementing State Machines in PostgreSQL (2017)
___________________________________________________________________
Implementing State Machines in PostgreSQL (2017)
Author : todsacerdoti
Score : 13 points
Date : 2025-05-08 20:22 UTC (2 hours ago)
(HTM) web link (felixge.de)
(TXT) w3m dump (felixge.de)
| michelpp wrote:
| While this is a good approach to implements state machines, the
| transition function is hardwired to one transition graph. Another
| approach is to generalize the state and transition graph into a
| table, and group those transitions by a machine id, as shown
| here:
|
| https://github.com/michelp/pgfsm
|
| Now many machines (sub-graphs of state transitions) can be
| defined in general, and the transition checking function checks
| the validity of the next state based on the table, instead of
| static rules in a function.
___________________________________________________________________
(page generated 2025-05-08 23:00 UTC)