I want to search for a string that is inside of a column of some table. The system has about 200 tables. I need to search all columns of all tables to achieve what I want.
Is it possible in Postgresql 12?
I want to search for a string that is inside of a column of some table. The system has about 200 tables. I need to search all columns of all tables to achieve what I want.
Is it possible in Postgresql 12?
If all that is needed are the tables and columns in which the value occurs, then the following query can be used:
Replace
regexwith a regular expression that will be true if the desired string occurs within the column and expand the schema list if needed.The query works by searching each character type column of each table for the pattern. For efficiency, the search of each column terminates as soon as a match is found.