I need to do a delete to clean the database automatically on tables that are within different schemas, the "public" and "cine";
I have the following query that returns me
SELECT concat('"',table_schema,'"', '.', '"',table_name, '"') as
table_name
FROM information_schema.columns
WHERE table_schema = 'public' OR table_schema = 'cine' AND
column_name = 'cine_uuid'
GROUP BY table_name, table_schema;
This, returns me all the schemas and tables that have as "cine_uuid" column. It is possible to delete as follows:
DELETE FROM [TABELAS] WHERE cine_uuid = '00000000-0000-0000-0000-000000000000'
What I wanted was for a query to do a delete on several tables in the various schemas.
Is it possible?