Wading through a database full of text (as might support a CMS) and feeling lost? Sometimes you gotta ditch the queries and just start grepping.
This Stack Overflow post sums up the idea. Here’s a version of the command we used today to pick through a text-rich database:
$ curl `heroku pg:backups public-url -rproduction` | pg_restore | egrep -o '[a-z]+\.chicagocatlounge.biz'
This found, via a regex match, all subdomains of our target URL, in any text field of the production database. Pretty awesome.Tweet