PostgreSQL is evolving beyond its traditional relational roots by adopting property graph query capabilities through SQL/PGQ. This extension enables graph-style pattern matching and traversal directly within PostgreSQL, removing the need for separate graph database systems. For database practitioners, this opens the door to analyzing complex relationships while continuing to rely on PostgreSQL’s mature relational storage, indexing, and performance features.
This session presents a hands-on case study of applying SQL/PGQ to real-world coffee trade data. The coffee supply chain represents a rich and complex graph of farmers, cooperatives, exporters, and markets, where structural bias and unequal opportunities often emerge. By modeling these entities and their relationships as property graphs, we can detect imbalances such as limited market access for smallholder farmers, regional disparities in pricing, and inequities between certified and non-certified producers. Importantly, this type of structural bias analysis is conceptually related to ML bias, where hidden patterns can lead to unfair or unintended outcomes—here applied at the level of trade networks rather than model predictions.
The talk will walk through the full process:
- Designing graph schemas from relational tables
- Building property graphs within PostgreSQL
- Writing SQL/PGQ queries to uncover bias and unfair patterns
- Combining relational and graph queries for deeper insights
- Interpreting and visualizing results in a reproducible workflow
Attendees will gain practical skills in constructing and querying property graphs in PostgreSQL, see how relational and graph paradigms can complement each other, and learn how to adapt these methods to their own datasets. Beyond coffee, the techniques demonstrated are broadly applicable to supply chains, recommendation systems, fraud detection, and fairness-aware analytics.
This session is designed for engineers, DBAs, and analysts who want to explore PostgreSQL’s upcoming graph capabilities in a tangible, real-world scenario, leaving with reproducible queries and actionable insights.