Web Application Development

Software Design for Complex Technical Challenges

Application Security Services

Application Testing

  • Ethical Hacking
  • Application Penetration Testing
  • Mobile App Pen testing

Mitigating Risk

  • Static Testing of Source Code
  • Security Architecture Analysis
  • Hybrid Assessment


  • Security Remediation Strategy
  • Incidence Response Strategy
  • Code Remediation


  • Security Training for Developers
  • HIPAA Compliance Consulting
  • PCI Compliance Consulting

UX and Web Development Clients



Graph Algorithms in a Database: Recursive CTEs and Topological Sort with Postgres

Posted by Iain on Jan. 26, 2017, 3:09 p.m.

Surprisingly, databases can be used to do graph algorithms. Using Postgres, this post pushes SQL to its Turing Complete limits by using a powerful device called a Recursive CTE to traverse complicated foreign key relationships as if they were directed graphs. It starts out simple and builds up to a query that will topologically sort any acyclic graph.