This file contains 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
with sequences as ( | |
select * | |
from ( | |
select table_schema, | |
table_name, | |
column_name, | |
replace(replace(replace(column_default, '::regclass)', ''), '''', ''), 'nextval(', 'public.') as col_sequence | |
from information_schema.columns | |
where table_schema not in ('pg_catalog', 'information_schema') and column_default ILIKE 'nextval(%' | |
) t |