Hacker News new | ask | show | jobs
by tyingq 1424 days ago
Pg_query maybe?

https://pganalyze.com/blog/pg-query-2-0-postgres-query-parse...

Scroll down to the section marked "Fingerprints in...".

1 comments

As far as I can tell, pg_query would treat the equivalent EXISTS and IN (...) forms as different queries with different fingerprints, which seems to fit it's intended use. The github README says:

> Usage: Fingerprinting a query

> Fingerprinting allows you to identify similar queries that are different only because of the specific object that is being queried for (i.e. different object ids in the WHERE clause), or because of formatting.

Pretty cool that we can get the parse tree that PostgreSQL would make from Go or Ruby via the library.