Does PostgreSQL have a variable character storage layer that optimizes storage space by automatic dedupe?
PostgreSQL has functions for regular expressions. 
PostgreSQL string functions 
So you can write triggers (function + dml event) to be done what you need. I don't believe it has some optimizer that compress strings across the records. Or maybe I didn't understand what you mean in the question.