Feature #803
Search For A Specific String In All Tables With PostgreSQL
Description
I recently needed to find all instances of a string in every table of a database with PostgreSQL. This is a simple process of how I did this.
- Dump a temporary copy of the database:
su - pgsql
pg_dump --data-only --inserts exampledb > exampledb.psql
- Then grep through the dumped database file looking for the string "someString"
grep someString exampledb.psql
Resources¶
Updated by Daniel Curtis over 8 years ago
- Subject changed from Search For A Specific String In All tables With PostgreSQL to Search For A Specific String In All Tables With PostgreSQL
- Status changed from New to Resolved
- % Done changed from 0 to 100