Skip to main content

Category: Programming

Polymorphic Relations in PostgreSQL Using JSON

Documentation for PostgreSQL’s JSON data type Summary Notes on using PostgreSQL’s JSON data-type using a hypothetical alerting system. The system receives a stream of system metrics and has different types of triggers which are associated with multiple types of subscribers. Demonstrated with two types of trigger: system load and filesystem usage. Tables Example table diagram with triggers and subscribers, where each is associated with a user. The triggers and subscribers are also linked to each other via a many-to-many (junction) table.

Polymorphic Relations in PostgreSQL Using Table Inheritance

Documentation for PostgreSQL’s Table Inheritance Table Inheritance Caveats Summary Notes on using PostgreSQL’s Table Interitance using a hypothetical alerting system. The system receives a stream of system metrics and has different types of triggers which are associated with multiple types of subscribers. Demonstrated with two types of trigger: system load and filesystem usage. Tables Example table diagram with triggers and subscribers, where each is associated with a user. The triggers and subscribers are also linked to each other via a many-to-many (junction) table.