Migrating tables to schemas
От | Chris Jewell |
---|---|
Тема | Migrating tables to schemas |
Дата | |
Msg-id | 4356C480.7050501@lancaster.ac.uk обсуждение исходный текст |
Ответы |
Re: Migrating tables to schemas
|
Список | pgsql-admin |
Hi, With an ever increasing number of tables being added to our research database, we have come to the conclusion that we need to confine individual users to private schemas instead of everybody creating their tables in the default public schema. In order to move the tables, I have used a CREATE TABLE <privateschema>.<tablename> AS SELECT * FROM public.<tablename>; command on each private table. This worked fine. However, when it came to DROPping the old tables from the public schema, I had trouble with user's views that were dependent on these tables. I don't want to use the CASCADE attribute as I don't want to erase all my users' views. Thus, my question is: can I migrate the views such that they point to the new tables in the users' schemata, and/or how do I drop the public schema tables without dropping the users' views? Thanks, Chris -- -- Chris Jewell, BSc(Hons), BVSc, MRCVS Dept of Maths and Statistics Fylde College Lancaster University Lancaster Lancs LA1 4YF
В списке pgsql-admin по дате отправления: