Re: error-free disabling of individual child partition
| От | Andrew Dunstan |
|---|---|
| Тема | Re: error-free disabling of individual child partition |
| Дата | |
| Msg-id | 44721AFA.4030405@dunslane.net обсуждение исходный текст |
| Ответ на | Re: error-free disabling of individual child partition ("Jim C. Nasby" <jnasby@pervasive.com>) |
| Список | pgsql-hackers |
Jim C. Nasby wrote: > On Mon, May 22, 2006 at 03:28:39PM -0400, Andrew Dunstan wrote: > >> Jim C. Nasby wrote: >> >>> BEGIN; >>> -- Don't do the drop right now, because it might take awhile >>> ALTER TABLE tablename RENAME TO delete_tablename; >>> ALTER TABLE temporary_tablename RENAME TO tablename; >>> COMMIT; >>> DROP delete_tablename; >>> >>> >>> >> What if there are dependencies? Might be better to have a view, which >> everything depends on, and change the view definition from one table to >> another back and forth. >> > > What dependencies would there be that a view would solve? You can't > define RI on a view AFAIK... > functions, rules, other views ... RI is not the only source of dependencies. you would do this: < load table_a > create or replace view v as select * from table_a; drop if exists table table_b; next time around swap table_a and table_b, or you could write some plpgsql or plperl to do it nicely for you. cheers andrew
В списке pgsql-hackers по дате отправления: