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
-- Create a query to delete all tables with a certain field name. | |
select array_to_string(array_agg(cmd), '; ') from ( | |
select concat('DROP TABLE "', t.table_name, '"') as cmd | |
from information_schema.tables t | |
inner join information_schema.columns c on c.table_name = t.table_name | |
and c.table_schema = t.table_schema | |
where c.column_name = 'geometry' | |
and t.table_schema not in ('information_schema', 'pg_catalog') | |
and t.table_type = 'BASE TABLE' | |
order by t.table_schema) as cmds |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.