You could take advantage of the fact that in PostgreSQL, tablename.*
can be cast to text.
So, SELECT t.* FROM tablename t WHERE (t.*)::text LIKE '%somestring%'
will return any row where any column contains somestring
, no matter what the type of the column.
If used in a loop on SELECT table_schema, table_name FROM information_schema
, it's comparable to a grep
within a database dump, except you don't need the dump.