I want to create a rule that transforms a query on one table to a query on
many with table names and columns named after one of the columns in the fake
table.
e.g.:
select a,b,c from foo where b='x.1' or b='y.1' or b='y.2';
to:
select a,'x.1',c from foo_x union
select a,'y.1',c from foo_y union
select a,'y.2',c from foo_y;
But it doesn't seem that I can manipulate the column data into table names
when I do it in a rule.
How can I do this?