Andrew Dunstan <andrew@dunslane.net> writes:
> What you're missing is that we need to compare the lockdeps of each item
> (i.e. both the candidate item and the running item) with all the deps
> (not just the lockdeps) of the other item. If neither item has any
> lockdeps there will be no conflict. This will allow concurrent index
> creation, since neither item will have any lockdeps. But it will prevent
> us selecting a create index that conflicts with a running FK creation or
> vice versa.
Oh, I see, you're using the deps as a proxy for the shared locks the
operation will acquire. Yeah, that might work. Seems like it's nearly
a one-liner fix, too.
regards, tom lane