Re: How to replace rows in table so that foreign key rows
В списке pgsql-general по дате отправления:
| От | Andrus |
|---|---|
| Тема | Re: How to replace rows in table so that foreign key rows |
| Дата | |
| Msg-id | e28jhr$ktj$1@news.hub.org обсуждение исходный текст |
| Ответ на | How to replace rows in table so that foreign key rows are not deleted ("Andrus" <eetasoft@online.ee>) |
| Список | pgsql-general |
> I did so, and for a table named 'country' the following SQL statements > were produced: > > -- Disable triggers > UPDATE pg_catalog.pg_class SET reltriggers = 0 WHERE oid = > 'country'::pg_catalog.regclass; > > /* COPY command goes here to bulk load table data. */ > > -- Enable triggers > UPDATE pg_catalog.pg_class SET reltriggers = (SELECT pg_catalog.count(*) > FROM pg_catalog.pg_trigger where pg_class.oid = tgrelid) WHERE oid = > 'country'::pg_catalog.regclass; Berend, thank you for bright idea. this may cause invalid foreign key data to be loaded into database. I want that in end of transaction Postgres will check for correctness of foreign keys like DEFERRED clause suggests. How this check can be forced ? Andrus.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера