-
-
Save vkostyanetsky/a58ff201d2a87a35e70c4c8f4112ad4c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT | |
| string_agg(issues.query_text, ' union all ') | |
| FROM ( | |
| SELECT | |
| 'select ''' | |
| || table_name | |
| || ''' as table, ''' | |
| || column_name | |
| || ''' as column_name, 1 AS counter from ' | |
| || table_name | |
| || ' where ' | |
| || column_name | |
| || ' > ''3999-11-01 00:00:00''::timestamp' AS query_text | |
| FROM | |
| information_schema.columns | |
| WHERE | |
| table_catalog = 'acc01' | |
| AND table_schema = 'public' | |
| AND data_type = 'timestamp without time zone' | |
| ORDER BY | |
| table_name, | |
| column_name | |
| ) AS issues; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment