From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
Cc: | Josh Berkus <josh(at)agliodbs(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: pg_restore dependencies |
Date: | 2009-04-10 23:50:18 |
Message-ID: | 3796.1239407418@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Andrew Dunstan <andrew(at)dunslane(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Abhijit Menon-Sen | 2009-04-11 04:47:47 | Allow COMMENT ON to accept an expression rather than just a string |
Previous Message | Dann Corbit | 2009-04-10 23:35:53 | Re: Windows installation service |