This article describes the application of PostgreSQL along with algorithms to extract keywords from a document for text (keyword) analysis.
This article discusses how you can use PostgreSQL along with ts_stat or MADlib for term frequency and Inverse document frequency analysis.