I just became aware of the SQL 2016 standard match_recognize feature, which allows for rich pattern matching across groups of rows. It’s a great feature, currently only supported in Oracle.
I can find no evidence it’s ever been discussed here and there’s no mention of it on the PG website.