When searching for underscores in Postgresql, literal use of the _ character does not work. For example, if you want to find all your tables for any columns ending in _by , for something like a change log or activity information, for example. updated_by , reviewed_by , etc., the following query almost always works:
SELECT table_name, column_name FROM information_schema.columns WHERE column_name LIKE '%_by'
Basically, it completely ignores the underscore and returns as if you were looking for LIKE '%by' . This may not be a problem in all cases, but it may be one. How to find underscores?
Joe m
source share