Re: Best Approach for Swapping a Table with its Copy

Поиск
Список
Период
Сортировка
От Greg Sabino Mullane
Тема Re: Best Approach for Swapping a Table with its Copy
Дата
Msg-id CAKAnmm+aGX9_HMbJQrGR8nwFbd60x4NqfexnYi22-wtrCT-cXw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Best Approach for Swapping a Table with its Copy  (Marcelo Fernandes <marcefern7@gmail.com>)
Список pgsql-general
On Sun, Feb 16, 2025 at 5:58 PM Marcelo Fernandes <marcefern7@gmail.com> wrote:
- The foreign keys are not being updated to point to the new table.

You started out okay with your test script, but the pg_depend bit needs work. I would recommend examining that table closely until you have a really good understanding of how it works - both on the objid and refobjid side. Create and modify tables and see how the pg_depend entries change. Hint: Try it with and without foreign keys.

 
- pg_repack seems to update relcache entries. I am not sure how to do that with SQL.

Yes, as I mentioned upthread, the safest thing will probably be a restart.

Cheers,
Greg

--
Enterprise Postgres Software Products & Tech Support

В списке pgsql-general по дате отправления: