| От | Tom Lane |
|---|---|
| Тема | Re: pg_restore dependencies |
| Дата | |
| Msg-id | 3796.1239407418@sss.pgh.pa.us обсуждение |
| Ответ на | Re: pg_restore dependencies (Andrew Dunstan <andrew@dunslane.net>) |
| Список | pgsql-hackers |
Andrew Dunstan <andrew@dunslane.net> writes:
> Tom Lane wrote:
>> ... Seems like it's nearly a one-liner fix, too.
> Well, what I have in mind is a bit bigger, but not large. See attached
> patch.
Hmm, you do need two instances of the loop, don't you? Might be
better to refactor along the lines of
if (has_lock_conflicts(te, running_te) || has_lock_conflicts(running_te, te)) // has a conflict
...
// true if te1 requires exclusive lock on any dependency of te2
static bool
has_lock_conflicts(te1, te2)
{for (j = 0; j < te1->nLockDeps; j++){ for (k = 0; k < te2->nDeps; k++) { if (te1->lockDeps[j] ==
te2->dependencies[k]) return true; }}return false;
}
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера