
cambiar tablas de esquemas
Publicado por outrera (35 intervenciones) el 24/04/2014 17:47:43
1
2
3
4
5
6
7
8
9
10
11
DO
$$
DECLARE
row record;
BEGIN
FOR row IN SELECT tablename FROM pg_tables WHERE schemaname = 'public' -- and other conditions, if needed
LOOP
EXECUTE 'ALTER TABLE public.' || quote_ident(row.tablename) || ' SET SCHEMA [new_schema];';
END LOOP;
END;
$$;
Valora esta pregunta


0