Question: How do you move tables and views from one schema to another?
Often times when you start a new database, you put all your tables and views in the public schema. For databases
with few tables and all relatively commonly grouped data, the benefits of using schemas for logical groupings vs. the downside
of having to reference it with the schema name is more trouble than its worth.
As time goes by and with organic growth, this simple database you had that does one thing suddenly starts doing a lot of other things
you hadn't initially planned for. Now to keep your sanity you really need the benefit of schemas for logical groupings. How do you
retroactively do this? The answer is not quite as easy as one would hope. Ideally you would want to do a RENAME from public.sometable to newschema.sometable,
but that doesn't work.