Postresql dynamic index creation for many tables
You can use dynamic SQL with a do statement that iterates over the tables in a schema:

do
$$
declare
 l_statement text;
 l_rec record;
begin
  for l_rec in select y 
               from x
  loop
    l_statement := format('create index on %I (z)', l_rec.y);
    execute l_statement;
  end loop;
end;
$$


Postgres will automatically generate a name for the new index.