I'm having a problem with the following, I need to create a trigger that when a given row is inserted it creates a SCHEMA with a specific structure! For example, in the public schema, I have the client table, and when I insert some client, I need to create a trigger with the client name.
INSERT INTO public.cliente (idcliente, nome) VALUES (2,'joao');
In that case, it would automatically create a SCHEMA with the name of John, but I have no idea how to do it.
I need to create a function that receives the name of SCHEMA as a parameter and within this function create SCHEMA?