Quantcast
Channel: Question and Answer » postgresql
Viewing all articles
Browse latest Browse all 1138

How to create a citation/quote from a Postgres text field?

$
0
0

I have a database with a lot of text and I want to find the surrounding text for a word that I am searching for i.e. If I search this text for “text” I should get something like (and more consistent than):

  • .. lot of text and ..
  • .. the surrounding text for ..
  • .. this text for “text”..
  • .. for “text” I should ..

I can write this in a program but I wondered if there is a good SQL trick to get something approaching this with just a query for a quick and dirty report.


Viewing all articles
Browse latest Browse all 1138

Trending Articles