> You could probably write an extension for that, though. I think the > planner hook and custom scans give you enough flexibility to do that > without modifying the server code.
Thanks for the advice. But I rather thought about bypassing the raw parser and the planner. i.e. use the query string (or its hash) as the index of the query cache.
I think you need to know which tables are involved and if they were modified.