Tom Lane wrote:
>
> Also, rather than running around and adding locks to every single
> place that calls heap_open or heap_close, I wonder whether we shouldn't
> have heap_open/heap_close themselves automatically grab or release
> at least a minimal lock (AccessShareLock, I suppose).
This could result in deadlocks...
> Or maybe better: change heap_open/heap_openr/heap_close to take an
> additional parameter specifying the kind of lock to grab. That'd still
> mean having to visit all the call sites, but it would force people to
> think about the issue in future rather than forgetting to lock a table
> they're accessing.
This way is better.
Vadim